-
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
Missing layers when building image with --cache-from #1678
Comments
+1 to this issue - we're seeing it as well. It breaks caching for us. |
seems to match description of #1568 |
@tonistiigi okay, I can try with Should the image in cache source also be built with the new version, or can I test it only while using |
You do need to export cache again. |
I've been able to reproduce a similar problem with Buildkit, running on docker version 19.03.8, build afacb8b7f0, with an example at https://github.com/gordz/moby-buildkit-cache-from-bug with Dockerfiles' and a script that reproduces the problem. I've included a
On the final rebuild, the resulting image is missing several layers, confirmed by running an If you plan to run the script, please be aware that it will remove local containers and images, and perform a prune, and you will need to replace the 2* FIXME placeholders with your own registry. Attached are logs from running the test I've scripted up - notice that in the final ls a bunch of files are missing (child-1.txt, child-2.txt, child-3.txt, child-4.txt) |
With |
@akshatflx thanks, I've tested with |
In one of the images I'm building with
cache-from
flag, the resultant image doesn't have all the expected layers. I'm usingDocker version 19.03.12, build 48a66213fe
Here's how I found this issue -
docker run <image> ls
and check that all files are present.DOCKER_BUILDKIT=1 docker build -t <imagename>:latest --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from=gcr.io/...<imagename>:latest ...
. Notice that all the build steps areCACHED
according to the logsdocker run <image> ls
again, on the newly built image. Notice that some of the files are missing (which are clearly added as per Dockerfile instructions).docker inspect
on both the images, I found that the newly built image doesn't have all the expected layers. Out of 14 instructions in the Dockerfile, it only contains the output of the first 6. New image is smaller in size as well.Here's a log file containing the output of above steps -
BuildLogs.txt
Some more tests/observations -
The text was updated successfully, but these errors were encountered: