-
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
Proposal: early stage layers from multi-stage builds should not be considered dangling #38071
Comments
I think with buildkit enabled this may not be an issue, but I'm not positive. |
Yes, with buildkit, the build-cache no longer creates those images; build-cache is kept separate from the image store, and can be pruned separately ( Docker 18.09 also brings a configurable garbage-collect policy for the build-cache (see #37846 for details) |
Is there documentation on this functionality somewhere? I'd like to understand how it works and make sure that it will meet out needs. |
Most information right now can be found in those pull requests (more documentation still has to be written), but you can try a release candidate of 18.09 to test those features, and check if the behavior matches your expectations / use-case. |
Is there a way to view the build-cache? |
The files themselves? Not sure tbh (@tiborvass @tonistiigi @AkihiroSuda should know). If I'm not mistaken, the size will show up in |
@daveisfera Build cache can be viewed with |
I can confirm that BuildKit handles this case correctly. 👍 (Probably safe to close since 23.0.0 will have BuildKit enabled by default?) |
This is a bit of the opposite request from #34151 and #34513 because currently we have to explicitly tag the early stages so that
docker image prune
doesn't clean them up and blow away build cache that should still be valid.The current workaround is to run the following:
This is inefficient because the build for the
build
stage has to happen twice. The second time it's all cached, but it means that the context has to be reloaded and this explicit tagging is required when it shouldn't be necessary because the image isn't dangling and is part of a tagged build.The text was updated successfully, but these errors were encountered: