-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Mount volume with Docker ONBUILD #12827
Comments
hm, i don't think it's the image's issue in this case. using |
If I understand your use-case correctly, this looks like a duplicate of #3056 (and #10199) @saturnism can you confirm that this is the case (and close this issue if I'm correct)? |
pretty similar - but should work in ONBUILD too :) |
Why is the dir not persistent? |
actually, this is very specific to some build processes that pulls down dependencies. rather than re-downloading the dependencies each build, dependencies are already versioned and static, it can be shared via a volume. for example, when building w/ maven:onbuild, it will pull down many dependencies from maven central. however, in a regular maven build environment, all of the dependencies are cached in ~/.m2/repository directory. it would be super nice if that' can be shared via a volume. thanks, |
This will also be super helpful when building on remote docker machines |
USER POLL The best way to get notified of updates is to use the Subscribe button on this page. Please don't use "+1" or "I have this too" comments on issues. We automatically The people listed below have upvoted this issue by leaving a +1 comment: @cyberjoac |
+1 |
With the buildkit builder you can mount cache mounts. Cache mounts can be just an empty dir that gets populated during the build, or it can even be an overlay from a pre-populated dir, from another build stage, etc. Closing since this should resolve most cases. |
Just used Maven image to turn Java source to image on build! Maven will downloads all the dependencies into /root/.m2/repository directory. But since the fs is not persistent, Maven will download all the dependencies on every single build.
It would be great if we can mount the repository directory when building - so that the dependencies don't need to be re-downloaded each time.
The text was updated successfully, but these errors were encountered: