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

Add support for configuring additional build contexts #306

Closed
laurazard opened this issue Feb 15, 2023 · 3 comments · Fixed by #307
Closed

Add support for configuring additional build contexts #306

laurazard opened this issue Feb 15, 2023 · 3 comments · Fixed by #307

Comments

@laurazard
Copy link
Member

laurazard commented Feb 15, 2023

What is the problem you're trying to solve

BuildKit added the --build-context argument to enable users to provide additional build contexts during a build. More documentation about this can be found here.

Describe the solution you'd like

Being able to configure additional build contexts in a Compose file, such as:

services:
  a:
    build:
      context: .
      build_contexts:
        - project=[a directory/image/etc.]

Used together with a Dockerfile such as:

# syntax=docker/dockerfile:1
FROM alpine:latest
COPY --from=project . /

Additional context
Add any other context about the feature request here.

@ndeloof
Copy link
Collaborator

ndeloof commented Feb 16, 2023

We should just use contexts as this is in the build section already

@laurazard
Copy link
Member Author

laurazard commented Feb 16, 2023

Sounds good! I was wondering whether having contexts next to context would be confusing. I wonder if it should be extra_contexts or something similar to be more explicit that it's optional (as opposed to context). WDYT?

@ndeloof
Copy link
Collaborator

ndeloof commented Feb 16, 2023

additional_contexts or named_contexts could indeed avoid confusion.
Also would probably better use of a mapping vs the name=path syntax introduced by buildx as a command line flag doesn't have much flexibility (we could support both, as we do in a few places already)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants