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 default
loop
File, 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 first
docker images -a
See 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. Sure
docker ps -a
Let’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.