/ var / lib / docker / overlay2 / ...很大,即使在docker上没有运行

时间:2020-06-16 07:42:50

标签: linux docker ubuntu devops

root@****:/home/****# docker system df
TYPE                TOTAL               ACTIVE              SIZE                RECLAIMABLE
Images              0                   0                   0B                  0B
Containers          0                   0                   0B                  0B
Local Volumes       0                   0                   0B                  0B
Build Cache         0                   0                   0B                  0B
root@****:/home/****# docker images -a
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
root@****:/home/****# docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS
NAMES

这是docker system df的输出,您可以看到没有图像或容器等。

但是,/ var / lib / docker / overlay2正在使用巨大的空间,如下所示:

root@****:/home/****# du -h /var/lib/docker/overlay2/ | sort -hr | head
139G    /var/lib/docker/overlay2/
5.9G    /var/lib/docker/overlay2/a7ea104e24413200b446f5ff91d6b6da2c9e737a61e13454c12b6f7acab79d40/diff/python-docker/****
5.9G    /var/lib/docker/overlay2/a7ea104e24413200b446f5ff91d6b6da2c9e737a61e13454c12b6f7acab79d40/diff/python-docker
5.9G    /var/lib/docker/overlay2/a7ea104e24413200b446f5ff91d6b6da2c9e737a61e13454c12b6f7acab79d40/diff
5.9G    /var/lib/docker/overlay2/a7ea104e24413200b446f5ff91d6b6da2c9e737a61e13454c12b6f7acab79d40
5.3G    /var/lib/docker/overlay2/d1e624c4d1ece71b701ee2100af88edb083a39edd2810c66d312f6e889241edb/diff/python-docker/****
5.3G    /var/lib/docker/overlay2/d1e624c4d1ece71b701ee2100af88edb083a39edd2810c66d312f6e889241edb/diff/python-docker
5.3G    /var/lib/docker/overlay2/d1e624c4d1ece71b701ee2100af88edb083a39edd2810c66d312f6e889241edb/diff
5.3G    /var/lib/docker/overlay2/d1e624c4d1ece71b701ee2100af88edb083a39edd2810c66d312f6e889241edb
5.3G    /var/lib/docker/overlay2/cfdccf54b0022c0c6739f5c09639d5faf62ceba1ecb7b649bc396174620fd3d6/diff/python-docker/****
...

我的码头工人信息如下:

root@****:/home/****# docker info
Client:
 Debug Mode: false

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 19.03.11
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc version:
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 4.15.0-106-generic
 Operating System: Ubuntu Core 16
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 31.33GiB
 Name: ****
 ID: ****
 Docker Root Dir: /var/snap/docker/common/var-lib-docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support

我不明白为什么/ var / lib / docker / overlay2中有这么多东西。确切地说,diff是造成这种情况的元凶。

ncdu 1.12 ~ Use the arrow keys to navigate, press ? for help
--- /var/lib/docker/overlay2/a7ea104e24413200b446f5ff91d6b6da2c9e737a61e13454c12b6f7acab79d40 ----------
                         /..
    5.8 GiB [##########] /diff                                                                                                                                 e   4.0 KiB [          ] /work
    4.0 KiB [          ]  lower
    4.0 KiB [          ]  link
    0.0   B [          ]  committed

0 个答案:

没有答案