dockerで不要な領域を解放して使用領域を減らす方法を紹介します。
「docker system prune」コマンドを使用します。
コマンド実行後、「Are you sure you want to continue? [y/N] 」と聞かれるので「y」を押すと処理が進みます。
やってみました。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# docker system prune WARNING! This will remove: - all stopped containers - all networks not used by at least one container - all dangling images - all dangling build cache Are you sure you want to continue? [y/N] y Deleted Containers: 10222224788e8bd47357bb67be06b19733997a20e6504728f7e521c232981b44 ~省略~ 123456789jdydydye051af38a1018ef8b855361de9e547706ceedea31f11b3fa Total reclaimed space: 6.948GB # # |
カモトラの場合、約6.9GBが削除され、スペースがふえました。
割と使用頻度高めなので覚えておいて損はありません。