-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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 without a shell is not working #26174
Comments
Marking this as enhancement because it's not working by design it seems, but I really think it should work 👼. I'll take a look, but /cc @talex5 |
Well, according to the documentation, it should work, so it looks more like a bug to me. https://docs.docker.com/engine/reference/builder/#healthcheck |
@vikstrous true 👼 but according to code, it calls |
This is certainly a bug. In wonder if we're attaching the json attribute to the wrong AST node. It's supposed to return it here: and check it here: |
We attached the JSON flag to the wrong AST node, causing Docker to treat the exec form ["binary", "arg"] as if the shell form "binary arg" had been used. This failed if "ls" was not present. Added a test to detect this. Fixes moby#26174 Signed-off-by: Thomas Leonard <[email protected]>
We attached the JSON flag to the wrong AST node, causing Docker to treat the exec form ["binary", "arg"] as if the shell form "binary arg" had been used. This failed if "ls" was not present. Added a test to detect this. Fixes #26174 Signed-off-by: Thomas Leonard <[email protected]>
We attached the JSON flag to the wrong AST node, causing Docker to treat the exec form ["binary", "arg"] as if the shell form "binary arg" had been used. This failed if "ls" was not present. Added a test to detect this. Fixes #26174 Signed-off-by: Thomas Leonard <[email protected]> (cherry picked from commit e95b6b5) Signed-off-by: Victor Vieux <[email protected]>
I think there's a regression here. My docker version:
The docker file: https://github.com/yegle/stubby-docker/blob/test-dockerfile-cmd/Dockerfile
Health check log:
|
/facepalm No regression here. I wrote |
Dockerfile healthchecks don't seem to work if there is no /bin/sh in the container even when using the [""] syntax to specify an executable to run.
Output of
docker version
:(equivalent to 1.12.1 for the purpose of this bug report)
Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
Steps to reproduce the issue:
Put this in a Dockerfile:
docker build -t fail .
docker run -d --name test --entrypoint sleep fail 1000
docker inspect test
Describe the results you received:
Describe the results you expected:
health check should succeed
Additional information you deem important (e.g. issue happens only occasionally):
In the config section of docker inspect I see:
The text was updated successfully, but these errors were encountered: