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
[BUG] docker-compose build is not caching layers #11804
Comments
compose does not run the build on it's own but just creates a build configuration for buildkit to build image(s) |
that's the crazy thing - I can't reproduce this behavior with Docker Desktop. But I also can't reproduce this issue with |
that's indeed probably an issue with compose configuring build execution (compose just setup buildx to run the build, it doesn't create layers on its own). We will welcome any PR to offer a fix so this works well on Colima, but you will easily understand that, as a Docker employee, I can't spend time debugging an issue that only applies to a competing product :) |
Have you tried modifying the BuildKit settings directly if possible, or forcing Docker Compose to use a different build method or configuration to see if that affects the caching behavior? Also could you compare the build context from Docker vs. Docker Compose? Sometimes there might be differences in how the context is packaged and sent to the builder which can affect caching. |
@ndeloof - of course, I appreciate your pointing me in the right direction, though. It guess there is something about how compose runs when on colima AND when buildkit is off, where it is creating layers uniquely from build to build such that it always has a cache-miss before building layers... |
Description
I'm on an M1 mac with colima. When I try to run
docker build .
in my repo, it caches layers - but when I rundocker-compose build
, it doesn't. AND it deletes the layers cached when I had rundocker build .
I also noticed that every time I run
docker-compose build
, the number of layers is increasing in my colima machine's/var/lib/docker/overlay2
. So I'm guessing it just can't find the cached layers and is continuing to create new layers in that folder?I'm curious why this might be the case and how I can get my docker-compose builds to start caching layers again?
Steps To Reproduce
No response
Compose Version
Docker Environment
Anything else?
No response
The text was updated successfully, but these errors were encountered: