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
An image that is being based on "scratch", has no shell in it. When using the HEALTHCHECK instruction in a Dockerfile, one can instruct that the healthcheck should run with CMD, not CMD-SHELL. However, when passing the --health-cmd flag to a docker run command, it will always prefix the command with CMD-SHELL. There is no way (afaik) to tell Docker to use CMD, and neither the ENTRYPOINT nor the SHELL instruction seem to influence this.
Is this a bug? Is there a known workaround? Is the solution to this missing from the documentation?
Steps to reproduce the issue:
Build an image from SCRATCH, and try to pass it a --health-cmd on docker run.
Describe the results you received:
It fails with an error, describing that the CMD-SHELL prefixed command will not run.
Describe the results you expected:
It should be possible to tell the cli that it would have to use the CMD prefixed command, so it runs in the same way as a CMD prefixed HEALTHCHECK in the Dockerfile or a healthcheck in the compose.yaml file would run.
Additional information you deem important (e.g. issue happens only occasionally):
I reported this issue moby/moby#43843, but got redirected to this repository. The issue came up when trying to add an optional healthcheck in the Dozzle container, as mentioned in amir20/dozzle#1814
Output of docker version:
Client:
Version: 20.10.7
API version: 1.41
Go version: go1.16.8
Git commit: v20.10.7
Built: Thu Jan 1 00:00:00 1970
OS/Arch: linux/amd64
Context: default
Experimental: true
Server:
Engine:
Version: 20.10.7
API version: 1.41 (minimum version 1.12)
Go version: go1.16.8
Git commit: v20.10.7
Built: Tue Jan 1 00:00:00 1980
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: v1.5.7
GitCommit: v1.5.7
runc:
Version: 1.0.0-rc95
GitCommit:
docker-init:
Version: 0.18.0
GitCommit:
Description
An image that is being based on "scratch", has no shell in it. When using the HEALTHCHECK instruction in a Dockerfile, one can instruct that the healthcheck should run with CMD, not CMD-SHELL. However, when passing the --health-cmd flag to a docker run command, it will always prefix the command with CMD-SHELL. There is no way (afaik) to tell Docker to use CMD, and neither the ENTRYPOINT nor the SHELL instruction seem to influence this.
Is this a bug? Is there a known workaround? Is the solution to this missing from the documentation?
Steps to reproduce the issue:
Build an image from SCRATCH, and try to pass it a --health-cmd on docker run.
Describe the results you received:
It fails with an error, describing that the CMD-SHELL prefixed command will not run.
Describe the results you expected:
It should be possible to tell the cli that it would have to use the CMD prefixed command, so it runs in the same way as a CMD prefixed HEALTHCHECK in the Dockerfile or a healthcheck in the compose.yaml file would run.
Additional information you deem important (e.g. issue happens only occasionally):
I reported this issue moby/moby#43843, but got redirected to this repository. The issue came up when trying to add an optional healthcheck in the Dozzle container, as mentioned in amir20/dozzle#1814
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
NixOS
The text was updated successfully, but these errors were encountered: