Why is docker image eating up my disk space that is not used by docker

前端 未结 9 2057
长发绾君心
长发绾君心 2020-12-12 11:07

I have setup docker and I have used completely different block device to store docker\'s system data:

[root@blink1 /]# cat /etc/sysconfig/docker
# /etc/sysc         


        
9条回答
  •  难免孤独
    2020-12-12 11:54

    Had the same problem. In my scenario my vbox was running out of storage space. After an investigation found out that my docker local volumes were eating up 30gb. Ubuntu 16.04 host.

    To find out yours.

    docker system df
    
    TYPE                TOTAL               ACTIVE              SIZE                RECLAIMABLE
    Images              3                   0                   1.361GB             1.361GB (100%)
    Containers          0                   0                   0B                  0B
    Local Volumes       7                   0                   9.413GB             9.413GB (100%)
    Build Cache                                                 0B                  0B
    
    
    
    docker system prune --volumes
    
    
      WARNING! This will remove:
            - all stopped containers
            - all networks not used by at least one container
            - all volumes not used by at least one container
            - all dangling images
            - all build cache
    Are you sure you want to continue? [y/N]
    

    This frees up disk space of not used local volumes. At my scenario freed 20 GB of storage space. Make sure that containers which you want to keep are running before doing this if you want to keep them since this removes all stopped containers.

提交回复
热议问题