Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BuildKit doesn't handle Dockerfile from stdin, when using remote context #38254

Closed
thaJeztah opened this issue Nov 22, 2018 · 3 comments · Fixed by docker/buildx#994
Closed
Assignees
Labels
area/builder kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. platform/desktop version/18.09
Milestone

Comments

@thaJeztah
Copy link
Member

Description

When building from a remote source, but with a local Dockerfile from stdin, docker build fails when using buildkit;

DOCKER_BUILDKIT=1 docker build -t statx --no-cache -f- https://github.com/whotwagner/statx-fun.git <<-EOF
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y gcc make
RUN mkdir /src/
WORKDIR /src/
COPY . .
RUN make
EOF

Results in buildkit attempting to use a file named - as Dockerfile;

[+] Building 1.2s (1/1) FINISHED                                                                                                                                                                                           
 => [internal] load git source https://github.com/whotwagner/statx-fun.git                                                                                                                                            1.2s
failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount863221464/-: no such file or directory

Wheras building without buildkit correctly handles - to use the Dockerfile from stdin;

DOCKER_BUILDKIT=0 docker build -t statx --no-cache -f- https://github.com/whotwagner/statx-fun.git <<-EOF
FROM ubuntu:18.04
RUN apt-get update && apt-get install -y gcc make
RUN mkdir /src/
WORKDIR /src/
COPY . .
RUN make
EOF
Sending build context to Docker daemon  110.6kB
Step 1/6 : FROM ubuntu:18.04
 ---> cd6d8154f1e1
Step 2/6 : RUN apt-get update && apt-get install -y gcc make
 ---> Running in dcec0e12771e
Get:1 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://security.ubuntu.com/ubuntu bionic-security/universe Sources [26.0 kB]
Get:5 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [1364 B]

Output of docker version:

Client: Docker Engine - Community
 Version:           18.09.0
 API version:       1.39
 Go version:        go1.10.4
 Git commit:        4d60db4
 Built:             Wed Nov  7 00:47:43 2018
 OS/Arch:           darwin/amd64
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          18.09.0
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.4
  Git commit:       4d60db4
  Built:            Wed Nov  7 00:55:00 2018
  OS/Arch:          linux/amd64
  Experimental:     true

Output of docker info:

Not relevant, but included below;

Containers: 10
 Running: 5
 Paused: 0
 Stopped: 5
Images: 127
Server Version: 18.09.0
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host ipvlan macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: active
 NodeID: g5l8yjyurr8xpie3k9xb08uqz
 Is Manager: true
 ClusterID: jrnii2o76lmneq8jrt9nz72ye
 Managers: 1
 Nodes: 1
 Default Address Pool: 10.0.0.0/8  
 SubnetSize: 24
 Orchestration:
  Task History Retention Limit: 5
 Raft:
  Snapshot Interval: 10000
  Number of Old Snapshots to Retain: 0
  Heartbeat Tick: 1
  Election Tick: 10
 Dispatcher:
  Heartbeat Period: 5 seconds
 CA Configuration:
  Expiry Duration: 3 months
  Force Rotate: 0
 Autolock Managers: false
 Root Rotation In Progress: false
 Node Address: 192.168.65.3
 Manager Addresses:
  192.168.65.3:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.125-linuxkit
Operating System: Docker for Mac
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 1.952GiB
Name: linuxkit-025000000001
ID: L3VR:6SGF:FS5T:YB7O:7IJZ:IOK3:2F2I:73K6:M5MP:55PZ:YDMN:YHUT
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 62
 Goroutines: 214
 System Time: 2018-11-22T19:25:52.274061223Z
 EventsListeners: 4
HTTP Proxy: gateway.docker.internal:3128
HTTPS Proxy: gateway.docker.internal:3129
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
@thaJeztah thaJeztah added area/builder kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. version/18.09 labels Nov 22, 2018
@thaJeztah
Copy link
Member Author

ping @tonistiigi @tiborvass @AkihiroSuda ptal

@thaJeztah
Copy link
Member Author

@tonistiigi I see moby/buildkit#947 was linked to this and is merged, but mentions "this enables implementing"; what changes are needed to make this work, and where do those changes have to be made?

@thaJeztah
Copy link
Member Author

Chatting with @tonistiigi on slack;

cli side needs to set dockerfilekey in frontend opt and local with the same name.

Let me add this to the 20.x milestone to see if we can get that fixed for that release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/builder kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. platform/desktop version/18.09
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants