Closed qianguih closed 5 days ago
Hiya @qianguih, thanks for the report.
I wouldn't think this is a Compose specific issue, but it's possible. Could you test this out with a plain build (docker build ...
, no Compose) of your Dockerfile and see if this still happens? Adding to that, you could narrow down whether this happens with BuildKit or the classic builder by testing again with DOCKER_BUILDKIT=0 docker build ...
.
With that information we'll be able to direct you to a more appropriate repo to report your issue in.
hi @laurazard , docker build
is fine. Here is what I did:
cp service.Dockerfile Dockerfile
docker build .
docker system prune -af --volumes
ls /var/lib/docker/overlay2
shows it's emptyDOCKER_BUILDKIT
doesn't work for my current docker setup due to the following:
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
BuildKit is currently disabled; enable it by removing the DOCKER_BUILDKIT=0
environment-variable.
@qianguih
DOCKER_BUILDKIT doesn't work for my current docker setup due to the following:
DEPRECATED: The legacy builder is deprecated and will be removed in a future release. BuildKit is currently disabled; enable it by removing the DOCKER_BUILDKIT=0 environment-variable.
This is just a warning, it should still build. Could you please try that way and let us know if you can replicate the issue with the legacy builder?
@qianguih I believe this is no longer reproducable. Coud you please check on your side?
Closing as user didn't answered Please open a follow-up issue is this is still relevant, with detailed context
Description
I observed
/var/lib/docker/overlay2
was slowly eating all disk space on my machine. So I dived into this and found the issue comes fromdocker compose
(or layer management for image built bydocker compose
). Here are the steps to illustrate the issue:/var/lib/docker/
to start fresh:sudo rm -rf /var/lib/docker/* && sudo systemctl restart docker
docker compose build
docker system prune -af --volumes
/var/lib/docker/overlay2
:docker system prune
didn't clean up these layers:965beae5f7717138f1692aebfdf217410c8979a3d9a230fa98af73377c87b59a
is the layer contain system lib. I don't fully understand why it's created but tests showed this layer is being reused across multiple builds. So this is not a concern.aqwgmdcpaqx8iegitwt91osnb
is the layer containing diff created by theCOPY
command inDockerfile
.onomfnueji94ninjm03iibrzz
is also created by that but it's just an empty folder so it's less concerning.docker compose build && docker system prune -af --volumes
COPY
commandSteps To Reproduce
No response
Compose Version
Docker Environment