Skip to content

Fix exec form of HEALTHCHECK CMD#26208

Merged
icecrime merged 1 commit intomoby:masterfrom
talex5:fix-health-test
Aug 31, 2016
Merged

Fix exec form of HEALTHCHECK CMD#26208
icecrime merged 1 commit intomoby:masterfrom
talex5:fix-health-test

Conversation

@talex5
Copy link
Copy Markdown
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
Copy Markdown
Member

LGTM

@vdemeester
Copy link
Copy Markdown
Member

Cool, thank @talex5
LGTM 🐸

@thaJeztah
Copy link
Copy Markdown
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