-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Add support for additional_contexts
in build
service config
#10369
Conversation
0ddcce9
to
70f3d38
Compare
70f3d38
to
84e7b67
Compare
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
84e7b67
to
e53bc57
Compare
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## v2 #10369 +/- ##
==========================================
- Coverage 53.37% 53.36% -0.02%
==========================================
Files 104 104
Lines 8927 8939 +12
==========================================
+ Hits 4765 4770 +5
- Misses 3642 3648 +6
- Partials 520 521 +1
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
@glours PTAL :) |
looks like we don't have coverage report for cucumber tests |
Yup, I was just realizing that. We probably need to do the |
yes we probably need GOCOVERDIR set somehow |
Heads-up, I hit upon an issue related to Assumedly this is because the context is being passed uninterpreted by compose to buildx. |
@EronWright according to the spec
but indeed, it would make sense we detect and expand relative paths. I'll investigate if this is feasible |
I have a problem with
it just comes out empty when |
Hiya @TeKa-Dev, I can't seem to reproduce this: $ ls /home/laurabrehm/.config/nvim/
init.lua lazy-lock.json LICENSE lua README.md stylua.toml services:
a:
build:
context: .
additional_contexts:
- dep=/home/laurabrehm/.config/nvim/ # syntax=docker/dockerfile:1
FROM alpine:latest
COPY --from=dep init.lua / $ docker compose build
...
$ docker run --rm -it build-a sh
/ ls
...
init.lua We might be able to help you if you provide a more complete reproduction scenario however. |
Hi, I was not accurate, not all directories with a dot cause the error, but $ docker buildx build . --build-context m2repository=/home/teka/.m2/repository/
[+] Building 1.1s (12/12) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 994B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 34B 0.0s
=> resolve image config for docker.io/docker/dockerfile:1.4 0.9s
=> CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a858632727cf7a112fbf 0.0s
=> [internal] load build definition from Dockerfile 0.0s
=> [internal] load .dockerignore 0.0s
=> [internal] load metadata for docker.io/library/alpine:latest 0.0s
=> [context m2repository] load .dockerignore 0.0s
=> => transferring m2repository: 102B 0.0s
=> [context m2repository] load from client 0.0s
=> => transferring m2repository: 406.09kB 0.0s
=> CACHED [stage-0 1/2] FROM docker.io/library/alpine:latest 0.0s
=> [stage-0 2/2] COPY --from=m2repository org / 0.0s
=> exporting to image 0.0s
=> => exporting layers 0.0s
=> => writing image sha256:c9a3f6a8e9a2f369d8cb5332c0f4652d44e35c52e622d2fc899851a3b30c87ac 0.0s services:
alpine:
build:
context: .
additional_contexts:
- m2repository=/home/teka/.m2/repository/ $ docker-compose build
[+] Building 2.1s (11/11) FINISHED
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 994B 0.0s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 34B 0.0s
=> resolve image config for docker.io/docker/dockerfile:1.4 1.9s
=> CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a858632727cf7a112fbf 0.0s
=> [internal] load build definition from Dockerfile 0.0s
=> [internal] load .dockerignore 0.0s
=> [internal] load metadata for docker.io/library/alpine:latest 0.0s
=> [context m2repository] load .dockerignore 0.0s
=> => transferring m2repository: 2B 0.0s
=> [context m2repository] load from client 0.0s
=> => transferring m2repository: 2B 0.0s
=> [stage-0 1/2] FROM docker.io/library/alpine:latest 0.0s
=> ERROR [stage-0 2/2] COPY --from=m2repository org / 0.0s
------
> [stage-0 2/2] COPY --from=m2repository org /:
------
failed to solve: failed to compute cache key: "/org" not found: not found I don't know if this is related but it doesn't work for me $ docker compose build
services.alpine.build Additional property additional_contexts is not allowed I use $ docker -v
Docker version 20.10.23, build 7155243
$ docker-compose -v
Docker Compose version v2.17.2 |
What I did
Implement support for
additional_contexts
as per compose-spec/compose-spec#307 and compose-spec/compose-go#354.Related issue
closes #9461
closes #9961
(not mandatory) A picture of a cute animal, if possible in relation to what you did