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

bake: local context not supported with remote git bake definition #641

Closed
tonistiigi opened this issue Jun 23, 2021 · 3 comments · Fixed by #671
Closed

bake: local context not supported with remote git bake definition #641

tonistiigi opened this issue Jun 23, 2021 · 3 comments · Fixed by #671
Milestone

Comments

@tonistiigi
Copy link
Member

Currently when using remote git bake definition buildx bake git:// then context is fixed as a relative directory inside the git location. It should be possible for remote bake to use local context. Possible solutions would be to define the path as local:// or special rule for path starting with ./

@tonistiigi tonistiigi added this to the v0.6.0 milestone Jun 23, 2021
@tonistiigi
Copy link
Member Author

@crazy-max Alternative idea is to support multiple git:// parameters in bake arguments. First would be where bake file is loaded, others can be used as sources. Inside the bake file you can use a predefined variable to get access to the source. Eg. content: ${SOURCE_CONTEXT}. That variable is replaced with the second git address or with local workdir when not present.

Eventually, we would need some kind of import mechanism when "helper bake definition" would be imported in the main one and main one can just call the helper actions directly.

@crazy-max
Copy link
Member

@tonistiigi

Possible solutions would be to define the path as local://

This solution sound good to me for a first iteration.

Alternative idea is to support multiple git:// parameters in bake arguments. First would be where bake file is loaded, others can be used as sources. Inside the bake file you can use a predefined variable to get access to the source. Eg. content: ${SOURCE_CONTEXT}. That variable is replaced with the second git address or with local workdir when not present.

I think this one can be confusing if this variable is already used in global scope or overrided in a configuration file (#541).

Eventually, we would need some kind of import mechanism when "helper bake definition" would be imported in the main one and main one can just call the helper actions directly.

I like the helper idea to allow users to declare "modules" which allow collections of configuration to be retrieved from external sources like Terraform does.

@tonistiigi
Copy link
Member Author

As discussed offline local: has quite breaking issues for not being able to switch between git and workdir context. For the variable, we can make it more specific, eg. with BAKE_ prefix, and deny users from using the same names in their vars. There are more use-cases for builtin vars.

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

Successfully merging a pull request may close this issue.

2 participants