我的 Macbook air 只有 128 GB 的硬碟空間(對這不叫內存!!!!!!)
在某次build image的時候出現空間不足的錯誤
起初我以為是我硬碟空間不夠
看了看剩餘空間
的確只剩下幾百M
刪除了一些大檔案
總算清出幾G
但重新 build 還是出現空間不足
原來 docker 用了 qemu 模擬了一塊硬碟
是這個空間用光了
而不是我的電腦磁碟空間沒了
docker 有提供 prune 的指令可以清空沒用到的內容
$ docker system prune -a
WARNING! This will remove:
- all stopped containers
- all networks not used by at least one container
- all images without at least one container associated to them
- all build cache
Are you sure you want to continue? [y/N]
按下 y 之後清出了3G多的空間
終於可以繼續 build 了
或是使用
$ docker volume prune