The images downloaded by docker add up to less than 3G, but what happened when more than 10 g of stored files were used?

  docker, question

Many of the images I downloaded have the same id. I tried to add them. the addition of different ids is about 3G, but the size of the/var/lib/doc directory is 13G, which just started two containers. there are some junk files in it. is it some cache when I made the images, how can I delete these?

If your host is CentOS and you use the defaultloopFile, that can’t, CentOS has no Union FS implementation, this sparse file to simulate is going to grow. Ubuntu/Debian won’t have this problem.

As for the problem of clearing unused images and constructing intermediate images. You can go firstdocker images -aSee if there are too many<none>Some of them are such images. Delete them directlydocker rmi $(docker images -aq -f "dangling=true"). Then look at it again, it should be much less.

In addition, the contents of your container are also in the storage layer. Suredocker ps -aLet’s see if there are many previous containers that have not been deleted. Also, it is ok.docker rm $(docker ps -aq -f "dangling=true")To delete.