container: add --health-cmd-mode for CMD healthcheck form#7008
Open
lohitkolluri wants to merge 1 commit into
Open
container: add --health-cmd-mode for CMD healthcheck form#7008lohitkolluri wants to merge 1 commit into
lohitkolluri wants to merge 1 commit into
Conversation
b67bde6 to
e09b71d
Compare
|
How about an option Just in case the future has even more modes possible, so changing this is easier? |
|
Or Up to the maintainers to know what they prefer, but I'm just throwing the idea out there. |
e09b71d to
ec531ea
Compare
Author
|
@andrebrait Great suggestion — updated to Changes in the latest commit:
|
ec531ea to
02221de
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
02221de to
4c9f13d
Compare
docker run/create always wrapped --health-cmd in CMD-SHELL, which fails on scratch and other shell-less images. Add --health-cmd-mode=exec to produce the exec (CMD) form, matching Dockerfile HEALTHCHECK CMD behavior. The default "shell" preserves existing --health-cmd behavior unchanged. Signed-off-by: Lohit Kolluri <lohitkolluri@gmail.com>
4c9f13d to
426b622
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
docker run/createalways wraps--health-cmdinCMD-SHELL, whichfails on scratch and other shell-less images (#3719).
Add
--health-cmd-modewith two values:shell(default)CMD-SHELL— identical to existing behaviorexecCMD), required for images without a shellThis mirrors the
CMD/CMD-SHELLdistinction in DockerfileHEALTHCHECKinstructions.Usage
Test plan
go test ./cli/command/container/... -run TestParseHealthmake mddocs(docs regenerated in this commit)Fixes #3719