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

Named build context with multiple sources #2836

Open
SpecLad opened this issue Dec 3, 2024 · 1 comment
Open

Named build context with multiple sources #2836

SpecLad opened this issue Dec 3, 2024 · 1 comment
Labels
kind/enhancement New feature or request status/triage

Comments

@SpecLad
Copy link

SpecLad commented Dec 3, 2024

Description

For my use case, it would be useful if you could create a single additional build context from multiple sources.

For example, suppose I have a directory /tmp/a, containing a.txt, and a directory /tmp/b, containing b.txt. I would like to be able to run something like the following:

docker buildx build . --build-context foo=/tmp/a --build-context foo=/tmp/b

And have the build context foo contain both a.txt and b.txt.

I only need this to work when both sources are local directories, although for consistency it would be nice if other source types were supported too.

@SpecLad SpecLad added kind/enhancement New feature or request status/triage labels Dec 3, 2024
@tonistiigi
Copy link
Member

You can solve this with a bake target that does the combining of the context and sets result as an input to other target. For build command I think this case is too app-specific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request status/triage
Projects
None yet
Development

No branches or pull requests

2 participants