Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Many thanks for buildkit ! This PR adds the ability to mount local host directory.
Which could help solve #3310 #4508 ...
and I'm aware of https://github.com/moby/buildkit/blob/master/PROJECT.md#client
Especially:
Let me explain why I feel this is useful : There are cases where we control everything (daemon, production of DAG, launching build) and don't really care about these security features but want to use DAG solver, caching of buildkit. I see buildkit as... a build kit. I can understand the security features in other environments.
My use case here is that I need to provide caching data that is produced by other external tools before buildkit comes into play, and no, I don't want to copy this into the states of buildkitd because it is utterly inefficient (the mount data is huge and always changing = invalidating cache).
Yes, I'm aware that it breaks reproducibility garantees big time, and I value reproducibility. But not this time, because I have my own garantees that what I plan to mount-bind is not breaking reproducibility. And to be honest, reproducibility is broken in most end-user (I thinking of most
Dockerfile
) usage of buildkit to my knowledge.Would something approaching this working implementation be of any interests ? I was thinking of additional safeguards (like command line args on the buildkitd like
--allow-bind-host
to allow the behavior only if specified), and I'll gladly add tests of course if the idea is accepted.With this implementation, the following works:
A final note: I'm very new to the go language, to buildkit concepts and history, so I might have overlooked simple concepts or solutions, made terrible mistakes in my implementation. So any feedback is more than welcome.