3.5 清理镜像(prune)

使用Docker一段时间后,系统中可能会遗留一些临时的镜像文件,以及一些没有被使用的镜像,可以通过docker image prune命令来进行清理。

支持选项包括:

  • -a, --all:删除所有无用镜像,不光是临时镜像;

  • --filter filter:只清理符合给定过滤器的镜像;

  • -f, --force:强制删除镜像,而不进行提示确认。

$ docker image prune
WARNING! This will remove all dangling images.
Are you sure you want to continue? [y/N] y
Total reclaimed space: 0B

Last updated