How to clean up Docker

前端 未结 5 778
旧巷少年郎
旧巷少年郎 2021-01-31 08:19

I\'ve just noticed that I ran out of disk space on my laptop. Quite a lot is used by Docker as found by mate-disk-usage-analyzer:

The docker/

5条回答
  •  北恋
    北恋 (楼主)
    2021-01-31 08:42

    This dir is where container rootfs layers are stored when using the AUFS storage driver (default if the AUFS kernel modules are loaded).

    If you have a bunch of *-removing dirs, this is caused by a failed removal attempt. This can happen for various reasons, the most common is that an unmount failed due to device or resource busy.

    Before Docker 17.06, if you used docker rm -f to remove a container all container metadata would be removed even if there was some error somewhere in the cleanup of the container (e.g., failing to remove the rootfs layer). In 17.06 it will no longer remove the container metadata and instead flag the container with a Dead status so you can attempt to remove it again.

    You can safely remove these directories, but I would stop docker first, then remove, then start docker back up.

提交回复
热议问题