-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Healthcheck cli arguments CMD vs CMD-SHELL #28385
Comments
It should use the |
Do we have some way to set " |
What would the syntax be for specifying a command without using a shell? JSON on the command-line? |
We don't allow specifying json on command line, yeah its not nice. On 14 Nov 2016 11:44, "Thomas Leonard" notifications@github.com wrote:
|
@talex5 yeah that's the tricky part… I would tend to only use @justincormack yep this is an orthogonal issue, but using the defined |
#28438 for using the Container configured shell instead of hardcoded ones. |
This doesn't look solved yet - at least I don't see how to specify on the CLI to not use a shell at all. |
HEALTHCHECK
supportsCMD
andCMD-SHELL
as command to run.CMD-SHELL
make docker prepend the healthcheck command with/bin/sh
(hard-coded in the source code) — This makes it not work with some images that would not have a/bin/sh
inside (liketraefik
orswarm
or …).This is ok, but any healthcheck
cli
flag (forrun
orservice create/update
) is only usingCMD-SHELL
. This makes it impossible to set a custom healthcheck for any image that do not provide a/bin/sh
binary inside the image.I think we should either do the other way around (i.e. using
CMD
by default on cli flags) or find a way to detect/specify if it should useCMD-SHELL
orCMD
.Note that on
docker build
the use ofCMD
andCMD-SHELL
is set depending on whether theHEALTHCHECK CMD
is specified as a string or an array. We're also gonna do the same forcompose
(both here and in docker/compose)/cc @thaJeztah @aanand @dnephin @talex5
The text was updated successfully, but these errors were encountered: