-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
buildkit uses multi-phase build export cache invalidation #4272
Comments
Can you share the command line you're using? Are you using See https://docs.docker.com/build/cache/backends/#cache-mode. |
This is the command I am currently using After testing, I looked at the website, made some changes, and tried the following command |
@xiangshen123 you need to include Something like: |
After listening to your suggestion, I will change the order as follows。 I did the same build twice, the code did not change at all, according to the actual situation, the second build file did not change, should all the mirror layer will not change, should all go cache, but I found that it did not go cache After changing to this command, I found that it took me longer to pack. Here are the details of packing Construct information for the first time:
I wonder why it takes so long to build and it doesn't feel like the cache is working |
Can you help me see exactly why that is |
From the output you share, it looks like the cache is working - "CACHED" is in the output, for each step, so the cache is working. The export step is taking more time now, since there is more cache to export - this is the disadvantage of I'm going to close this issue, since it looks like this is resolved - feel free to keep discussing though 🎉 |
buildkit builds in much lower time when using multi-stage builds than when not using multi-stage builds. After I changed dockerfile to multi-stage build in production environment, the build time is three times longer than the original single-stage build time. The specific analysis feels that the export cache is not effective, is there any way to solve this problem
The text was updated successfully, but these errors were encountered: