Skip to content

Inaccurate Results from docker system df #942

@braunsonm

Description

@braunsonm

Description

Steps to reproduce the issue:
Unknown, however this results from using multiple FROM statements in a Dockerfile with docker build . in my experience.

Describe the results you received:
After running a build, Docker seems to keep multiple layers in it's VFS storage that cannot be seen through docker system df -v

Note the results from docker system df -v

Images space usage:

REPOSITORY          TAG                 IMAGE ID            CREATED ago         SIZE                SHARED SIZE         UNIQUE SiZE         CONTAINERS
<none>              <none>              dbcf26a1afe3        29 hours ago ago    1.754GB             1.748GB             5.572MB             1
microsoft/dotnet    2-sdk               9969575612df        2 weeks ago ago     1.748GB             1.748GB             0B                  0

Containers space usage:

CONTAINER ID        IMAGE               COMMAND                  LOCAL VOLUMES       SIZE                CREATED ago         STATUS                      NAMES
e81177326b98        dbcf26a1afe3        "/bin/sh -c 'sed -i …"   0                   349MB               29 hours ago ago    Exited (137) 29 hours ago   jovial_babbage

Local Volumes space usage:

VOLUME NAME         LINKS               SIZE

Build cache usage: 0B

Note how it also says build cache usage is at 0B. Now note the output of the VFS directory:

1.8G    /var/lib/docker/vfs/dir/0478c82626f2680e23a285b2d8f97f2a91d0ea9bfc0bf35320307c821956bb7d
1.8G    /var/lib/docker/vfs/dir/1f6bee7f0e35932bed711496b14cb58fbb07017c5a98fcf5893bb924e89c2ea4
288M    /var/lib/docker/vfs/dir/2bea78b30abf2e5137e91d963c1980d90c4a9dd58bc4e019710f646ad13548eb
111M    /var/lib/docker/vfs/dir/416dedbc38925c3370753f742e8b8c326a04d1cbaa5302c42eb8f8f28d49b9aa
628M    /var/lib/docker/vfs/dir/5d437a35347ec637156103ed49639481a3f4608adcf59df66685d4f032d83e7b
319M    /var/lib/docker/vfs/dir/6272847cccecd9865fbf7f401caafdf3db65127c56439760d5a2674fd0c6a7da
141M    /var/lib/docker/vfs/dir/6721f9783ec22414952f74adefb778a9734024c4bdddcdc0e937554dd7cdfc52
1.8G    /var/lib/docker/vfs/dir/b6a42cc371e1b434dc0e5be1ed055415733ad357aa5b55d73761290c3e79cccd
2.1G    /var/lib/docker/vfs/dir/d3ce012e587e0e30e71bbcef51529e924b483bcad588ac77242916429b9816b3
1.8G    /var/lib/docker/vfs/dir/d3ce012e587e0e30e71bbcef51529e924b483bcad588ac77242916429b9816b3-init
134M    /var/lib/docker/vfs/dir/fa0feaa5e6a458b2aa4564cd4c72f21b9ef2c822b65aeadf008a0b21b82de7f8
1.8G    /var/lib/docker/vfs/dir/fa170a62ba9e7d0ce63e476b0f120266448158b5e7b088bf193b79eda7f08d01

That is over 12GB of unaccounted for space being used.

Output from ncdu:

Describe the results you expected:
Docker should list all layers still in storage in the vfs/ directory.

Additional information you deem important (e.g. issue happens only occasionally):
Note that this seems to only happen when using docker in docker.

It should be noted that this build is only about 500mb. There is no reason to be using 12Gb, and I can't seem to find out where all of this is coming from.

Output of docker version:

Docker version 17.12.0-ce, build c97c6d6

Output of docker info:

Containers: 1
 Running: 1
 Paused: 0
 Stopped: 0
Images: 3
Server Version: 17.12.0-ce
Storage Driver: vfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 89623f28b87a6004d4b785663257362d1658a729
runc version: b2567b37d7b75eb4cf325b77297b140ea686ce8f
init version: 949e6fa
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.0-5-amd64
Operating System: Ubuntu 16.04.3 LTS (containerized)
OSType: linux
Architecture: x86_64
CPUs: 1
Total Memory: 492.5MiB
Name: 92f9d719f428
ID: TSGE:4SAZ:DERM:ZDYI:4KFJ:V44F:RBKJ:RXL7:72KB:FEXW:AY2H:YCWI
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Additional environment details (AWS, VirtualBox, physical, etc.):
Vultr VPS with Docker in Docker.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions