Open cgzones opened 1 week ago
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
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"]