Help us understand the problem. What is going on with this article?

【個人メモ】マシン上のdocker imageを速やかに全て削除したい

More than 5 years have passed since last update.

docker imageを作っていると...

docker imageを作る際、何度も何度もdocker build .を実行する。
そのうち作ったdocker imageによってディスクが圧迫されているので
docker imageを削除したい。強制削除しても問題はない。

その場合どうすればいいのかなーとググってたら
ギッハブのissueにdocker containerを全て削除するワンライナーコマンドが載っていた。

https://github.com/dotcloud/docker/issues/3258#issuecomment-31098353

> sudo docker ps -a | grep Exit | awk '{print $1}' | sudo xargs docker rm

その後、docker imageを全部削除する以下のコマンドを実行すれば良い。

> sudo docker rmi $(sudo docker images -q)
futoase
Welcome to underground...
https://matsuzaki.dev/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした