Contributing guidelines
I've found a bug and checked that ...
Description
If you've got a target with a context defined, when baking the target remotely, the context does not have the Git context prepended.
Interestingly it actually is resolved correctly to find the Dockerfile (from the remote), so it'll actually fail on the first COPY.
Expected behaviour
COPY commands reference files from the context in the Git remote
Possibly output like this:
$ docker buildx bake 'https://example.com/myrepo.git' foo --print
{
"target": {
"foo": {
"context": "https://example.com/myrepo.git:bar",
"dockerfile": "Dockerfile"
}
}
}
Actual behaviour
COPY tries to copy from local path
$ docker buildx bake 'https://example.com/myrepo.git' foo --print
{
"target": {
"foo": {
"context": "bar",
"dockerfile": "Dockerfile"
}
}
}
Buildx version
github.com/docker/buildx 0.10.4 c513d34
Docker info
Client:
Context: pinkypie
Debug Mode: false
Plugins:
buildx: Docker Buildx (Docker Inc.)
Version: 0.10.4
Path: /usr/lib/docker/cli-plugins/docker-buildx
compose: Docker Compose (Docker Inc.)
Version: v2.17.2
Path: /home/milas/.docker/cli-plugins/docker-compose
Server:
Containers: 2
Running: 0
Paused: 0
Stopped: 2
Images: 24
Server Version: 23.0.3
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Using metacopy: true
Native Overlay Diff: false
userxattr: false
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: io.containerd.runc.v2 runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 1fbd70374134b891f97ce19c70b6e50c7b9f4e0d.m
runc version:
init version: de40ad0
Security Options:
seccomp
Profile: builtin
cgroupns
Kernel Version: 6.1.24-1-MANJARO
Operating System: Manjaro Linux
OSType: linux
Architecture: x86_64
CPUs: 24
Total Memory: 62.72GiB
Name: pinkypie
ID: LMGH:VDPN:Y2ZA:WRZA:ZQXA:U66B:KX3K:KY7C:SPFT:RX6Q:YV7M:DUN2
Docker Root Dir: /var/lib/docker
Debug Mode: false
Username: milas
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Builders list
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
default docker
default default running 23.0.3 linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/386
pinkypie * docker
pinkypie pinkypie running 23.0.3 linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/386
Configuration
Here's a hypothetical example to make it easy to follow:
https://example.com/myrepo.git
myrepo/
├── docker-bake.hcl
└── bar/
├── Dockerfile
└── super-cool.txt
docker-bake.hcl
target foo {
context = "./bar"
}
./bar/Dockerfile
FROM scratch
COPY super-cool.txt /
Attempt to build... 💥
docker buildx bake \
'https://example.com/myrepo.git' \
foo
This will end up with an error such as
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref moby::zhw5urpf8sto3shv0hjhbnpcj: "/super-cool.txt": not found
Build logs
No response
Additional info
Here's my real-world case that's a bit messier 🙃 :
docker buildx bake --print \
'https://github.com/milas/rock5-toolchain.git#rknn' \
yolov8-model-rknn
Notice that the context is rknn on the target!
This actually works if you override the context:
docker buildx bake --print \
--set='*.context=https://github.com/milas/rock5-toolchain.git#rknn:rknn' \
'https://github.com/milas/rock5-toolchain.git#rknn' \
yolov8-model-rknn
(fyi that target takes a bit and has some big layers so wouldn't necessarily bother building it)
Contributing guidelines
I've found a bug and checked that ...
Description
If you've got a target with a
contextdefined, when baking the target remotely, the context does not have the Git context prepended.Interestingly it actually is resolved correctly to find the
Dockerfile(from the remote), so it'll actually fail on the firstCOPY.Expected behaviour
COPYcommands reference files from the context in the Git remotePossibly output like this:
Actual behaviour
COPYtries to copy from local pathBuildx version
github.com/docker/buildx 0.10.4 c513d34
Docker info
Builders list
Configuration
Here's a hypothetical example to make it easy to follow:
https://example.com/myrepo.gitdocker-bake.hcl./bar/DockerfileAttempt to build... 💥
docker buildx bake \ 'https://example.com/myrepo.git' \ fooThis will end up with an error such as
Build logs
No response
Additional info
Here's my real-world case that's a bit messier 🙃 :
docker buildx bake --print \ 'https://github.com/milas/rock5-toolchain.git#rknn' \ yolov8-model-rknnNotice that the
contextisrknnon the target!This actually works if you override the context:
(fyi that target takes a bit and has some big layers so wouldn't necessarily bother building it)