moby icon indicating copy to clipboard operation
moby copied to clipboard

ENTRYPOINT does not work with 23.x CLI and 19.x daemon

Open poneding opened this issue 2 years ago • 4 comments

Description

Build image docker will ignore ENTRYPOINT in docker 23.x And this bug causes the compiled image to run getting error 'Error response from daemon: No command specified' in the k8s cluster.

btw, i install docker follow docker docs.

Reproduce

Dockerfile

FROM nginx
ENTRYPOINT ["echo", "hello world"]

build image

$ docker build . -t ngx -f Dockerfile && docker inspect ngx |grep -i entrypoint
"Entrypoint": null,
"Entrypoint": null,

Expected behavior

$ docker inspect ngx |grep -i entrypoint
Entrypoint: ["echo", "hello world"]

docker version

Client: Docker Engine - Community
 Version:           23.0.1
 API version:       1.40 (downgraded from 1.42)
 Go version:        go1.19.5
 Git commit:        a5ee5b1
 Built:             Thu Feb  9 19:46:56 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          19.03.5
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.12
  Git commit:       633a0ea838
  Built:            Wed Nov 13 07:28:45 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.16
  GitCommit:        31aa4358a36870b21a992d3ad2bef29e1d693bec
 runc:
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

docker info

-

Additional Info

No response

poneding avatar Feb 14 '23 06:02 poneding

19.03.5 is EOL for a quite some time.

btw, i install docker follow docker docs.

Do you have a link?

crazy-max avatar Feb 14 '23 07:02 crazy-max

Yes, from the output, it looks like the CLI was updated, but the Docker Engine (daemon) itself not, and that is still running a very old version.

This output is also confusing, because the container.io package (which contains runc) is updated to 1.6.16, but it looks like there's a very old pre-release of runc installed;

containerd:
  Version:          1.6.16
  GitCommit:        31aa4358a36870b21a992d3ad2bef29e1d693bec
 runc:
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657

@srcio wondering how you installed the engine, and how containerd (and runc) were installed. What Linux distribution are you running on? (perhaps you can update the first comment to include the output of docker info add well?

thaJeztah avatar Feb 14 '23 21:02 thaJeztah

Yes, from the output, it looks like the CLI was updated, but the Docker Engine (daemon) itself not, and that is still running a very old version.

This output is also confusing, because the container.io package (which contains runc) is updated to 1.6.16, but it looks like there's a very old pre-release of runc installed;

containerd:
  Version:          1.6.16
  GitCommit:        31aa4358a36870b21a992d3ad2bef29e1d693bec
 runc:
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657

@srcio wondering how you installed the engine, and how containerd (and runc) were installed. What Linux distribution are you running on? (perhaps you can update the first comment to include the output of docker info add well?

Linux distribution: Ubuntu 20.04 (amd64)

I uninstalled docker before and reinstalled it this time followed this page install docker enging

i have downgrade docker client to 20.10.22, and everything ok now.

Client: Docker Engine - Community
 Version:           20.10.22
 API version:       1.40
 Go version:        go1.18.9
 Git commit:        3a2c30b
 Built:             Thu Dec 15 22:28:08 2022
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          19.03.5
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.12
  Git commit:       633a0ea838
  Built:            Wed Nov 13 07:28:45 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.16
  GitCommit:        31aa4358a36870b21a992d3ad2bef29e1d693bec
 runc:
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

poneding avatar Feb 15 '23 00:02 poneding

i have downgrade docker client to 20.10.22, and everything ok now.

It looks like only the CLI (client) was downgraded. The 20.10 CLI does not use BuildKit by default, and will use the deprecated "legacy builder". From your report, it's very likely there's an issue with older versions of BuildKit (like the version included in Docker 19.03).

Is your daemon (engine) running locally or is it running on a remote machine (or a separate VM?). I'd highly recommend upgrading to a supported version if possible, because both Docker 19.03 and runc v1.0.0-rc8 are no longer maintained and have known vulnerabilities.

thaJeztah avatar Feb 15 '23 09:02 thaJeztah