1. 查看docker 空间使用情况,包括镜像、容器和(本地)volume。

      1. [root@worker1 ~]# docker system df
      2. TYPE TOTAL ACTIVE SIZE RECLAIMABLE
      3. Images 3 0 319.9MB 319.9MB (100%)
      4. Containers 0 0 0B 0B
      5. Local Volumes 1 0 156.5kB 156.5kB (100%)
      6. Build Cache 0 0 0B 0B
    2. 查看实时事件(例如容器创建,删除等均会实时显示)

    [root@worker1 ~]# docker system events

    1. 查看docker 系统信息(同docker info)

    [root@worker1 ~]# docker system info

    1. docker清理(清理停止的容器,没用容器使用的网络,镜像,缓存)
      1. [root@worker1 ~]# docker system prune
      2. WARNING! This will remove:
      3. - all stopped containers
      4. - all networks not used by at least one container
      5. - all dangling images
      6. - all dangling build cache
      7. Are you sure you want to continue? [y/N] y
      8. Total reclaimed space: 0B