Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly convert multi argument entrypoint #119

Open
cgzones opened this issue Oct 3, 2024 · 1 comment
Open

Correctly convert multi argument entrypoint #119

cgzones opened this issue Oct 3, 2024 · 1 comment

Comments

@cgzones
Copy link

cgzones commented Oct 3, 2024

Currently a compose entrypoint of

/usr/bin/tini -- wait-for-it opensearch:9200 -- /docker-entrypoint.sh

gets translated into

Entrypoint=/usr/bin/tini -- wait-for-it opensearch:9200 -- /docker-entrypoint.sh

while it should be

Entrypoint=["/usr/bin/tini", "--", "wait-for-it opensearch:9200", "--", "/docker-entrypoint.sh"]

@k9withabone
Copy link
Member

Huh, I thought podman run --entrypoint worked the same way as the ENTRYPOINT instruction in a Containerfile/Dockerfile (using the string form as an argument to /bin/sh -c), but after testing it out just now it seems that it doesn't.

Do you know how Docker Compose works with the different forms for entrypoint? Does it act like docker run --entrypoint (which presumably works the same as Podman), or like the ENTRYPOINT instruction (in which case the correct conversion would add "/bin/sh", "-c" to the beginning)? The Compose Specification is frustratingly vague on if the entrypoint string form can even contain multiple arguments.

As a workaround, you can use a list/array for the Compose service entrypoint as well:

services:
  foo:
    image: bar
    entrypoint: ["/usr/bin/tini", "--", "wait-for-it opensearch:9200", "--", "/docker-entrypoint.sh"]

Which converts to:

# foo.container
[Container]
Entrypoint=["/usr/bin/tini","--","wait-for-it opensearch:9200","--","/docker-entrypoint.sh"]
Image=bar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants