You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
container: add --health-cmd-mode for CMD healthcheck form
docker run/create always wrapped --health-cmd in CMD-SHELL, which breaks
scratch and other images without a shell. Add --health-cmd-mode=exec to
use the exec (CMD) form, matching Dockerfile HEALTHCHECK CMD behavior.
The default "shell" keeps existing --health-cmd behavior unchanged.
Fixes#3719
Signed-off-by: Lohit Kolluri <lohitkolluri@gmail.com>
flags.StringVar(&copts.healthCmd, "health-cmd", "", "Command to run to check health")
266
+
flags.StringVar(&copts.healthCmdMode, "health-cmd-mode", "shell", `Healthcheck command mode: "shell" runs via CMD-SHELL (default), "exec" uses the exec form (CMD) and is required for images without a shell`)
264
267
flags.DurationVar(&copts.healthInterval, "health-interval", 0, "Time between running the check (ms|s|m|h) (default 0s)")
265
268
flags.IntVar(&copts.healthRetries, "health-retries", 0, "Consecutive failures needed to report unhealthy")
266
269
flags.DurationVar(&copts.healthTimeout, "health-timeout", 0, "Maximum time to allow one check to run (ms|s|m|h) (default 0s)")
Copy file name to clipboardExpand all lines: docs/reference/commandline/container_create.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,7 @@ Create a new container
48
48
|`--gpus`|`gpu-request`|| GPU devices to add to the container ('all' to pass all GPUs) |
49
49
|`--group-add`|`list`|| Add additional groups to join |
50
50
|`--health-cmd`|`string`|| Command to run to check health |
51
+
|`--health-cmd-mode`|`string`|`shell`| Healthcheck command mode: `shell` runs via CMD-SHELL (default), `exec` uses the exec form (CMD) and is required for images without a shell |
51
52
|`--health-interval`|`duration`|`0s`| Time between running the check (ms\|s\|m\|h) (default 0s) |
52
53
|`--health-retries`|`int`|`0`| Consecutive failures needed to report unhealthy |
53
54
|`--health-start-interval`|`duration`|`0s`| Time between running the check during the start period (ms\|s\|m\|h) (default 0s) |
Copy file name to clipboardExpand all lines: docs/reference/commandline/container_run.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,7 @@ Create and run a new container from an image
50
50
|[`--gpus`](#gpus)|`gpu-request`|| GPU devices to add to the container ('all' to pass all GPUs) |
51
51
|`--group-add`|`list`|| Add additional groups to join |
52
52
|`--health-cmd`|`string`|| Command to run to check health |
53
+
|`--health-cmd-mode`|`string`|`shell`| Healthcheck command mode: `shell` runs via CMD-SHELL (default), `exec` uses the exec form (CMD) and is required for images without a shell |
53
54
|`--health-interval`|`duration`|`0s`| Time between running the check (ms\|s\|m\|h) (default 0s) |
54
55
|`--health-retries`|`int`|`0`| Consecutive failures needed to report unhealthy |
55
56
|`--health-start-interval`|`duration`|`0s`| Time between running the check during the start period (ms\|s\|m\|h) (default 0s) |
Copy file name to clipboardExpand all lines: docs/reference/commandline/create.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,6 +48,7 @@ Create a new container
48
48
|`--gpus`|`gpu-request`|| GPU devices to add to the container ('all' to pass all GPUs) |
49
49
|`--group-add`|`list`|| Add additional groups to join |
50
50
|`--health-cmd`|`string`|| Command to run to check health |
51
+
|`--health-cmd-mode`|`string`|`shell`| Healthcheck command mode: `shell` runs via CMD-SHELL (default), `exec` uses the exec form (CMD) and is required for images without a shell |
51
52
|`--health-interval`|`duration`|`0s`| Time between running the check (ms\|s\|m\|h) (default 0s) |
52
53
|`--health-retries`|`int`|`0`| Consecutive failures needed to report unhealthy |
53
54
|`--health-start-interval`|`duration`|`0s`| Time between running the check during the start period (ms\|s\|m\|h) (default 0s) |
Copy file name to clipboardExpand all lines: docs/reference/commandline/run.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,7 @@ Create and run a new container from an image
50
50
|`--gpus`|`gpu-request`|| GPU devices to add to the container ('all' to pass all GPUs) |
51
51
|`--group-add`|`list`|| Add additional groups to join |
52
52
|`--health-cmd`|`string`|| Command to run to check health |
53
+
|`--health-cmd-mode`|`string`|`shell`| Healthcheck command mode: `shell` runs via CMD-SHELL (default), `exec` uses the exec form (CMD) and is required for images without a shell |
53
54
|`--health-interval`|`duration`|`0s`| Time between running the check (ms\|s\|m\|h) (default 0s) |
54
55
|`--health-retries`|`int`|`0`| Consecutive failures needed to report unhealthy |
55
56
|`--health-start-interval`|`duration`|`0s`| Time between running the check during the start period (ms\|s\|m\|h) (default 0s) |
0 commit comments