Skip to content

Unable to reset entrypoint #41770

@lbndev

Description

@lbndev

Description
As reported in #41745:

I've just ran "apt-get upgrade" on my CI, which upgraded docker to "Docker version 20.10.0, build 7287ab3".
Now builds are not passing anymore ("dockerfile parse error line xxx: ENTRYPOINT requires at least one argument") when the Dockerfile attempts to reset the entrypoint from the parent image using ENTRYPOINT [].

Steps to reproduce the issue:
Below a very simplified version of my Dockerfile:

DOCKER_BUILDKIT=1 docker build -t foo -<<'EOF'
# syntax=docker/dockerfile:experimental
FROM maven:3.6.3-jdk-8-slim as javabuild
RUN --mount=type=cache,id=mvn,target=/usr/share/maven/ref/repository \
    mvn version:help 

FROM javabuild

RUN echo "sonar"

# Reset entrypoint from parent image
ENTRYPOINT []

EOF

Describe the results you received:

[+] Building 0.6s (4/4) FINISHED
 => [internal] load build definition from Dockerfile                                                                                                                                                                                    0.0s
 => => transferring dockerfile: 307B                                                                                                                                                                                                    0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                       0.0s
 => => transferring context: 2B                                                                                                                                                                                                         0.0s
 => resolve image config for docker.io/docker/dockerfile:experimental                                                                                                                                                                   0.0s
 => CACHED docker-image://docker.io/docker/dockerfile:experimental@sha256:1fbe6f83ffb91b4a9919c2bf359b22e7508f8670c1443389b01848db91ef1083                                                                                              0.0s
failed to solve with frontend dockerfile.v0: failed to solve with frontend gateway.v0: rpc error: code = Unknown desc = failed to create LLB definition: dockerfile parse error line 12: ENTRYPOINT requires at least one argument

Describe the results you expected:

A successful build.
The Dockerfile has not been modified, it worked perfectly on Docker 19.03 before I ran the apt-get upgrade.

Additional tests done:
If I remove the first line (# syntax=docker/dockerfile:experimental) and mount on the RUN command, the "minimal testcase" works as expected.
But that's not something I'm willing to do on all my Dockerfiles in all projects under our CI, because the caching capabilities during builds have greatly reduced our build times (thanks to the team for this feature, btw).

Output of docker version:

Client: Docker Engine - Community
 Version:           20.10.0
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        7287ab3
 Built:             Tue Dec  8 18:59:53 2020
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.0
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       eeddea2
  Built:            Tue Dec  8 18:57:44 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.3
  GitCommit:        269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc:
  Version:          1.0.0-rc92
  GitCommit:        ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Output of docker info:


Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Build with BuildKit (Docker Inc., v0.4.2-docker)

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 12
 Server Version: 20.10.0
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk s                                                                                                                                                             yslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 269548fa27e0089a8b8278fc4fc781d7f65a939b
 runc version: ff819c7e9184c13b7c2607fe6c30ae19403a7aff
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 4.15.0-101-generic
 Operating System: Ubuntu 18.04.5 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 15.66GiB
 Name: ci-node-1
 ID: JMTB:MV5N:DFIK:T6VA:BMPB:46DT:R6XZ:CLOJ:7NDD:ZVVP:BYXY:7L2F
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Registry Mirrors:
  https://docker-nexus.mycompany.com/
 Live Restore Enabled: false

WARNING: No swap limit support

Additional environment details (AWS, VirtualBox, physical, etc.):

Ubuntu VM running on VMWare vSphere.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions