container: add --health-cmd-mode for CMD healthcheck form#7008
container: add --health-cmd-mode for CMD healthcheck form#7008lohitkolluri 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
|
@andrebrait Great suggestion — updated to Changes in the latest commit:
|
|
@thaJeztah — when you have a moment, could you please take a review pass on this? Happy to address any feedback. Thank you. |
ec531ea to
02221de
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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. Fixes docker#3719 Signed-off-by: Lohit Kolluri <lohitkolluri@gmail.com>
02221de to
4c9f13d
Compare
CI failure root-cause analysis and fixesTwo 1.
|
|
Hi @thaJeztah — gentle follow-up when you have a moment. The lint failures ( Could you please:
Happy to make any further changes if anything else comes up in review. Thank you for your time. |
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