Display Docker Space Usage

2020-04-21

Command docker system df lists how much disk space Docker uses up, and for what.

For example:

$ docker system df
TYPE                TOTAL               ACTIVE              SIZE                RECLAIMABLE
Images              23                  7                   10.46GB             9.495GB (90%)
Containers          7                   7                   7.755GB             0B (0%)
Local Volumes       4                   4                   100.6MB             0B (0%)
Build Cache         0                   0                   0B                  0B

If you need a more detailed breakdown, option -v is there for you (output truncated):

$ docker system df -v
Images space usage:

REPOSITORY                          TAG                            IMAGE ID            CREATED              SIZE                SHARED SIZE         UNIQUE SIZE         CONTAINERS
<none>                              <none>                         0aae9c14d0a5        25 hours ago         1.018GB             1.016GB             1.955MB             0
exasol/docker-db                    6.2.5-d1                       5351441714d5        4 weeks ago          4.309GB             4.309GB             0B                  0
minio/minio                         RELEASE.2020-02-27T00-23-05Z   5836a22e6092        7 weeks ago          54MB                54MB                0B                  0
python                              3.7-stretch                    3fcd43e567d1        8 weeks ago          941.3MB             0B                  941.3MB             0
postgres                            12.2-alpine                    401832474328        2 months ago         153.6MB             153.6MB             0B                  1
python                              3.7-slim-stretch               89411a8b761c        2 months ago         155.3MB             155.3MB             0B                  0
alpine                              3.11                           e7d92cdc71fe        3 months ago         5.591MB             5.591MB             0B                  0
puckel/docker-airflow               1.10.7                         122ab2c6aeb9        3 months ago         741.3MB             741.3MB             0B                  0
antora/antora                       latest                         5711eb60c7f8        5 months ago         90.88MB             0B                  90.88MB             0
localstack/localstack               0.10.2                         b3d3f7b06b7d        8 months ago         860.2MB             0B                  860.2MB             0
alpine                              3.10.1                         b7b28af77ffe        9 months ago         5.582MB             0B                  5.582MB             0
localstack/localstack               0.9.4                          5c6c5a293024        11 months ago        1.291GB             0B                  1.291GB             0
quay.io/testcontainers/ryuk         0.2.3                          64849fd2d464        14 months ago        10.69MB             0B                  10.69MB             0
alpine                              3.5                            f80194ae2e0c        14 months ago        3.996MB             0B                  3.996MB             0

Containers space usage:

CONTAINER ID        IMAGE                               COMMAND                  LOCAL VOLUMES       SIZE                CREATED              STATUS                        NAMES
1a633294607d        minio/minio                         "/bin/sh -c '(cd /da…"   1                   0B                  About a minute ago   Up About a minute (healthy)   local-s3_1
3b09421e9ab7        postgres:12.2-alpine                "docker-entrypoint.s…"   1                   63B                 About a minute ago   Up About a minute (healthy)   postgres_1

Local Volumes space usage:

VOLUME NAME                                                        LINKS               SIZE
postgres-data                                                      1                   50.97MB
logs                                                               1                   157.6kB
s3-data                                                            1                   6.087kB
979b2df08cac02b75013e6982541e99fc0fac4fa4b46c75e34dfb4580ee44a6b   1                   49.87MB

Build cache usage: 0B

CACHE ID            CACHE TYPE          SIZE                CREATED             LAST USED           USAGE               SHARED

If you decide there is just too much junk, you may be looking for docker system prune; I for one think it is usually too blunt an instrument, though.

ToolDockerDevOps

Manage IDEA Changelists for Bad Lines