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

Fix exec form of HEALTHCHECK CMD #26208

Merged
merged 1 commit into from
Aug 31, 2016
Merged

Conversation

talex5
Copy link
Contributor

@talex5 talex5 commented Aug 31, 2016

- What I did

My code for parsing the HEALTHCHECK command didn't work correctly for JSON-format commands because I was attaching 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 "sh" was not present. I added a test to detect the problem and fixed it.

Fixes #26174

- How to verify it

Try the example in the linked bug report.

- Description for the changelog

Fix exec form of HEALTHCHECK CMD

Signed-off-by: Thomas Leonard thomas.leonard@docker.com

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 <thomas.leonard@docker.com>
@tonistiigi
Copy link
Member

LGTM

@vdemeester
Copy link
Member

Cool, thank @talex5
LGTM 🐸

@thaJeztah
Copy link
Member

ping @vieux looks like this fixes a bug in 1.12, I'm adding this to the 1.12.2 milestone for consideration

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

Successfully merging this pull request may close these issues.

healthcheck without a shell is not working
7 participants