Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Running docker-gc while a pull is running corrupts the image #43

Closed
nistvan86 opened this issue Aug 13, 2015 · 3 comments
Closed

Running docker-gc while a pull is running corrupts the image #43

nistvan86 opened this issue Aug 13, 2015 · 3 comments

Comments

@nistvan86
Copy link

If a docker pull is running while docker-gc executes it deletes intermediate layers of the currently pulled image, corrupting the download. If you try to create a container from the corrupt image, it shows an error that it cannot find an intermediate image.

On a machine of mine I'm running a similar code which removes untagged images with the command:
docker rmi $(docker images -q --filter "dangling=true")
This has the same issues and because of that I'm running it only nightly once when there's no other maintenance method is running.

I wonder if this could be improved somehow. It would be really helpful to run docker-gc more often on eg. a Jenkins build machine, where each commit can trigger a new build with a new image and we can run out of disk space quickly.

This can be really hard to fix because of the race conditions.

@dalanlan
Copy link
Contributor

I believe this should be taken care of docker itself inherently.

@dalanlan
Copy link
Contributor

Check docker pr #13681
Should be addressed in 1.8.0 (didnt give it a test though)

@nistvan86
Copy link
Author

Good finding. I think the main ticket for the issue is this: moby/moby#8926
Closing, thanks!

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

No branches or pull requests

2 participants