LoginSignup
49
37

More than 5 years have passed since last update.

docker system df と docker system prune を使ってみた

Posted at

dockerの1.13から便利なコマンドが増えたので、遅ればせながら試してみました。

開発しながらだと使い捨てのイメージやボリュームが溜まりがちなので、きれいになってスッキリしました。
Dockerでディスク容量が圧迫されて、困る前に実行してみてください。


$ docker system df
TYPE                TOTAL               ACTIVE              SIZE                RECLAIMABLE
Images              51                  12                  13.8GB              12.64GB (91%)
Containers          14                  0                   2.379GB             2.379GB (100%)
Local Volumes       47                  4                   6.754GB             5.841GB (86%)
$ docker system prune
WARNING! This will remove:
    - all stopped containers
    - all volumes not used by at least one container
    - all networks not used by at least one container
    - all dangling images
Are you sure you want to continue? [y/N] y
〜〜中略〜〜

$ docker system df
TYPE                TOTAL               ACTIVE              SIZE                RECLAIMABLE
Images              39                  0                   13.8GB              13.8GB (100%)
Containers          0                   0                   0B                  0B
Local Volumes       0                   0                   0B                  0B
49
37
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
49
37