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

inconsistent bake files merge order #2236

Closed
crazy-max opened this issue Feb 1, 2024 · 0 comments · Fixed by #2237
Closed

inconsistent bake files merge order #2236

crazy-max opened this issue Feb 1, 2024 · 0 comments · Fixed by #2237
Labels
area/bake kind/bug Something isn't working
Milestone

Comments

@crazy-max
Copy link
Member

follow-up:

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

@crazy-max crazy-max added kind/bug Something isn't working area/bake labels Feb 1, 2024
@crazy-max crazy-max added this to the v0.12.2 milestone Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/bake kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant