Philipp Grigoryev
Philipp Grigoryev

Reputation: 2118

Cached Docker image?

I created my own image and pushed it to my repo on docker hub. I deleted all the images on my local box with docker rmi -f ...... Now docker images shows an empty list.

But when I do docker run xxxx/yyyy:zzzz it doesn't pull from my remote repo and starts a container right away.

Is there any cache or something else? If so, what is the way to clean it all?

Thank you

Upvotes: 4

Views: 15663

Answers (2)

Popeye
Popeye

Reputation: 12093

I know this is old now but thought I'd share still.

Docker will contain all those old images in a Cache unless you specifically build them with --no-cache, to clear the cache down you can simply run docker system prune -a -f and it should clear everything down including the cache.

Note: this will clear everything down including containers.

Upvotes: 14

Andy Shinn
Andy Shinn

Reputation: 28493

You forced removal of the image with -f. Since you used -f I'm assuming that the normal rmi failed because containers based on that image already existed. What this does is just untag the image. The data still exists as a diff for the container.

If you do a docker ps -a you should see containers based on that image. If you start more containers based on that same previous ID, the image diff still exists so you don't need to download anything. But once you remove all those containers, the diff will disappear and the image will be gone.

Upvotes: 1

Related Questions