-
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
Docker-compose cache_from (using buildkit) builds to wrong step #1711
Comments
Reproducer? |
Unfortunately it's a private repo. I might be able to privately share at least the dockerfile, docker-compose yaml and the output in the CI server. Let me know how I can do that, if it's useful. |
In an effort to be slightly more helpful, I've redacted the dockerfile a bit:
Using the above without a cache results in a working container with each touched file where it should be. A subsequent build of exactly the same git checkout, with no changes, results in build output showing each layer is CACHED (although that output is not in the correct step order, but I assume that's normal for buildkit) and pushing the image shows that the all of the layers already existed. However, pulling the rebuilt image back down on my locla machine and running it shows that only |
Also of interest: when the image is build from scratch, the push involves these layers:
However, when that is used as the cache for the next build, fewer layers are in the push:
|
Digging around in the built image more, the result of |
You can also test #1568 (19.03.13) |
Thanks, I'll try to give this a go (confirmed we're on 19.03.2) right now. |
I can confirm that 19.03.13 fixes this issue. |
@tonistiigi What If we are using an older docker version on Google CloudBuild, but specify frontend version: |
I have a single stage Dockerfile. If I build it with docker-compose from scratch, everything works well. In this build I have
BUILDKIT_INLINE_CACHE=1
and I'm pushing to AWS ECR. When, for subsequent builds, I use the previously built image as a cache withcache_from
, the subsequent build will be built to the wrong step (as evidenced by missing files in the image) despite every step showing up in the output as CACHED.This is making it impossible to rely on the cache.
The text was updated successfully, but these errors were encountered: