If your host is CentOS and you are using the default loop file, there is no way. CentOS does not have Union FS implementation, and this sparse file will continue to grow if simulated. Ubuntu/Debian does not have this problem.
As for the issue of clearing unused images and building intermediate images. You can docker images -a 看一下是不是有过多的 <none> 的镜像了,其中有一部分是这类镜像。删除他们直接 docker rmi $(docker images -aq -f "dangling=true") first. Then it should be much less if you look at it again.
In addition, the contents of your container are also in the storage layer. Can be deleted with docker ps -a 看一下是不是有很多之前的容器没有删掉的,同样,也可以 docker rm $(docker ps -aq -f "dangling=true").
If your host is CentOS and you are using the default
loop
file, there is no way. CentOS does not have Union FS implementation, and this sparse file will continue to grow if simulated. Ubuntu/Debian does not have this problem.As for the issue of clearing unused images and building intermediate images. You can
docker images -a
看一下是不是有过多的<none>
的镜像了,其中有一部分是这类镜像。删除他们直接docker rmi $(docker images -aq -f "dangling=true")
first. Then it should be much less if you look at it again.In addition, the contents of your container are also in the storage layer. Can be deleted with
docker ps -a
看一下是不是有很多之前的容器没有删掉的,同样,也可以docker rm $(docker ps -aq -f "dangling=true")
.