containers / podlet

Generate Podman Quadlet files from a Podman command, compose file, or existing object
https://crates.io/crates/podlet
Mozilla Public License 2.0
422 stars 12 forks source link

Unexpected argument #60

Closed FamousL closed 7 months ago

FamousL commented 7 months ago

Attempting to convert a running container into a quadlet container:

0: error parsing podman command from: ["podman", "run", "--name=mastodon_sidekiq_1", "-d", "--requires=mastodon_website_1", "--label", "io.podman.compose.config-hash=a2ea646b70de97643dfd9c4355821226ff42d7d70bb1c97ab1de1535a3136f03", "--label", "io.podman.compose.project=mastodon", "--label", "io.podman.compose.version=1.0.6", "--label", "PODMAN_SYSTEMD_UNIT=podman-compose@mastodon.service", "--label", "com.docker.compose.project=mastodon", "--label", "com.docker.compose.project.working_dir=/opt/mastodon", "--label", "com.docker.compose.project.config_files=docker-compose.yml", "--label", "com.docker.compose.container-number=1", "--label", "com.docker.compose.service=sidekiq", "--env-file", "/opt/mastodon/application.env", "--env-file", "/opt/mastodon/database.env", "-v", "mastodon_uploads:/mastodon/public/system:z", "--net", "mastodon_internal_network,mastodon_external_network", "--network-alias", "sidekiq", "--restart", "always", "--healthcheck-command", "/bin/sh -c 'ps aux | grep '\"'\"'[s]idekiq 6'\"'\"' || false'", "tootsuite/mastodon:latest", "bundle", "exec", "sidekiq"] 1: error: unexpected argument '--healthcheck-command' found

looks like --health-cmd is supposed to cover the --healthcheck-command switch that is provided in podman

here is the compose directives covering this particular container: sidekiq: image: tootsuite/mastodon:latest env_file:

I was able to convert using the compose, however it did require a bit of massaging that was not necessary when running the container using podman-compose.

k9withabone commented 7 months ago

The podman-run(1) docs do not list --healthcheck-command as an alternative for --health-cmd. If you believe this to be a mistake, you should create an issue or PR at containers/podman.

I was able to convert using the compose, however it did require a bit of massaging that was not necessary when running the container using podman-compose.

I'm glad you were able to figure out something that worked for you. podman-compose works a little more fast and loose and silently ignores some things to make it work more or less like docker-compose. Podlet does a more straight up conversion of compose files and errors if something is not supported or works differently.

FamousL commented 7 months ago

That was a guess based on the names themselves. Since podman was able to pull up the containers from the docker-compose file using the --healthcheck-command argument, I badly phrased my query about if these were supposed to be the same argument.

Given a quick view of the documents I am guessing that my compose file is just malformed due to it's intended use being docker as opposed to podman.

k9withabone commented 7 months ago

Given a quick view of the documents I am guessing that my compose file is just malformed due to it's intended use being docker as opposed to podman.

You should take a look at the compose-spec, since that is what podman-compose is based on.

k9withabone commented 7 months ago

@FamousL, is there anything you would like to see changed in podlet regarding this? Otherwise, I'll close the issue.

FamousL commented 7 months ago

Should be ok to close it, I was laboring under the assumption the Mastodon folks had their compose file correct.