Skip to content
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 fails to clean up images due to missed dependency when copy --from is embedded in a base image #2838

Closed
swisslala opened this issue Nov 11, 2020 · 3 comments

Comments

@swisslala
Copy link

swisslala commented Nov 11, 2020

Docker fails to clean up images due to missed dependency when copy --from is embedded in a base image, buildkit does the same and fails to build due to race condition

Steps to reproduce the issue:
https://github.com/swisslala/docker-bug

Steps to reproduce issues are here
https://github.com/swisslala/docker-bug/blob/master/How-to-reproduce.md

  1. run ./build-1.sh
  2. run ./build-2.sh
  3. run docker images

Describe the results you received:
for each build docker seems to loose the link and ignores the clean up cmd, you end up with a bunch of images until your disk fills up

Describe the results you expected:
Intermediate images should be cleaned up

Additional information you deem important (e.g. issue happens only occasionally):
In the repo there is also scenario two which is the same issue. builkit builds the ast only within a context of a single dockerfile and doesnt seem to link dependencies across multiple FROM statements (see issue 2 in readme)

Output of docker version:

Docker version 19.03.13, build 4484c46d9d
@thaJeztah
Copy link
Member

Looks like this is the same issue as described in moby/buildkit#816

As to the untagged image; note that --force-rm is to remove the intermediate build containers used during build (when using the classic builder). For buildkit this is a "no-op", as it may not be using containers for various operations, and build containers used by buildkit won't show up in docker ps

@swisslala
Copy link
Author

I didnt realize there was an issue opened that long ago, yes its pretty much the same issue. It seems to me if an additional pass would be made to set up a dep then it could be fixed.

@thaJeztah
Copy link
Member

Thanks for confirming; let me close the ticket here to not have the conversation diverge, but perhaps you can post your details on the linked issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants