-
Notifications
You must be signed in to change notification settings - Fork 571
Closed
Labels
Milestone
Description
follow-up:
- bake: set cwd:// prefix for bake files path metadata-action#370 (comment)
- v5.5.0 Broke docker/bake-action with docker-metadata-action metadata-action#380
When using cwd://
prefix to load local files, the order when merging definitions is inconsistent.
Repro:
# docker-bake.hcl
target "default" {
dockerfile-inline = <<EOT
FROM scratch
COPY foo /foo
EOT
}
# docker-bake-cwd.hcl
target "default" {
dockerfile-inline = <<EOT
FROM scratch
COPY bar /bar
EOT
}
$ touch bar
$ docker buildx bake -f docker-bake.hcl -f cwd://docker-bake-cwd.hcl
#0 building with "integration-remote-50k0za15d0dzwgux4ky9yhd1e" instance using remote driver
#1 [internal] load local bake definitions
#1 reading docker-bake-cwd.hcl 80B / 80B done
#1 reading docker-bake.hcl 80B / 80B done
#1 DONE 0.0s
#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 64B done
#2 DONE 0.0s
#3 [internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s
#4 [internal] load build context
#4 transferring context: 2B done
#4 DONE 0.0s
#5 [1/1] COPY foo /foo
#5 ERROR: failed to calculate checksum of ref yckkdgn9arucath7i0lceuonf::4f9gaja38fx3nykbaexosznxj: "/foo": not found
------
> [1/1] COPY foo /foo:
------
Dockerfile:2
--------------------
1 | FROM scratch
2 | >>> COPY foo /foo
3 |
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref yckkdgn9arucath7i0lceuonf::4f9gaja38fx3nykbaexosznxj: "/foo": not found
In the logs we can see it loads first docker-bake-cwd.hcl
but should be docker-bake.hcl
.
Seems related to #1838