-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
JSONArgsRecommended: only warn if CMD/ENTRYPOINT has more than 1 arg #5423
Comments
Yes, if you don't use the JSON syntax then the CMD/ENTRYPOINT is expanded to @thaJeztah Should we consider changing the behavior when there is no custom shell? Or at least if the single arch is an absolute path? Has this ever been considered before? |
Ah, thank you! I hadn't appreciated the significance of this. |
Yes; was about to comment this; in the example case, the container will have |
Oh, there's an entrypoint as well. So even worse I think; echo -e "FROM alpine\nENTRYPOINT /bin/bash\nCMD yes\n" | docker build -t foo -
docker image inspect foo | jq -c .[].Config.Entrypoint
["/bin/sh","-c","/bin/bash"]
docker image inspect foo | jq -c .[].Config.Cmd
["/bin/sh","-c","yes"] LOL, not even sure what that actually runs; if both ["/bin/sh","-c","yes", "/bin/sh","-c","/bin/bash"] |
@tonistiigi not sure if it was ever discussed before. Would there be cases where this would be problematic? I agree from a usability perspective perhaps (but "absolute path" may be the tricky one in a cross-platform world). Guess that also implies the same for |
https://docs.docker.com/reference/dockerfile/#understand-how-cmd-and-entrypoint-interact Maybe it is not a good idea to have more exceptions to this. |
Is this warning helpful when
CMD
/ENTRYPOINT
only have a single argument?The text was updated successfully, but these errors were encountered: