958
788

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Docker一括削除コマンドまとめ

Last updated at Posted at 2017-04-03

停止コンテナ、タグ無しイメージ、未使用ボリューム、未使用ネットワーク一括削除

>=1.13

$ docker system prune

停止コンテナ一括削除

<=1.12

$ docker rm `docker ps -f "status=exited" -q`

>=1.13

$ docker container prune

全コンテナ一括削除

$ docker rm -f `docker ps -a -q`

未使用イメージ一括削除

<=1.12

$ docker rmi `docker images -q`

>=1.13

$ docker image prune

タグ無しイメージ一括削除

$ docker rmi `docker images -f "dangling=true" -q`

未使用ボリューム一括削除

<=1.12

$ docker volume rm `docker volume ls -q`

>=1.13

$ docker volume prune

未使用ネットワーク一括削除

<=1.12

$ docker network rm `docker network ls -q`

>=1.13

$ docker network prune
958
788
1

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
958
788

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?