LoginSignup
2

More than 5 years have passed since last update.

docker の古い image を削除

Last updated at Posted at 2016-09-07

CI で docker build してると古い images が disk を圧迫して

Step 11 : ADD . ./
Untar re-exec error: exit status 1: output: write /app/assets/images/hoge.gif: no space left on device

みたいなことになるので、 docker build, push したあとに古い image を削除するコマンドを実行しておくとよい。

shell-session:直近 100 images より古い myimage と tag なしの image を削除
docker rmi -f $(docker images -q myimage | sed -n '100,$p') $(docker images -q --filter "dangling=true")

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
2