marhkb / pods

Keep track of your podman containers
GNU General Public License v3.0
728 stars 12 forks source link

Add ability to pass options to container creation #719

Open distefam opened 1 year ago

distefam commented 1 year ago

There is a way to pass arguments to the command that is run in the container, however, I cannot find a way to pass options to the build command itself. Specifically, I would like to pass --env-file to podman-create.

bellegarde-c commented 9 months ago

Same here, I need --privileged otherwise, containers do not run.

marhkb commented 9 months ago

In general it's rather difficult to pass arbitrary option strings into the endpoint. It either needs changes in the underlying library podman-api rs libary (options builder would need some kind of hash map with string keys and probably json values) or in Pods I'd have to split the option string and let every part go through an if else with well known options and set the correct option on the builder.

So, for now I suggest we'd just add those options in the UI.

@distefam I'm not even sure if specifying an env file is part of the Podman RESTful API. I'm not sure because their API doc frontend seems very broken in general (https://docs.podman.io/en/latest/_static/api.html#tag/containers/operation/ContainerCreateLibpod doesn't show a request body at all). Specifying an env fle also not part in podman-api rs library and also not part of the docker documentation (https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerCreate). But nevertheless, we can make this a feature of Pods if you'd like create a new issue for that.

@bellegarde-c We can also expose that if you'd like to create a new issue.