LoginSignup
28
23

More than 5 years have passed since last update.

Dockerお掃除コマンド

Last updated at Posted at 2016-10-27

ググるとgrepやらawkやら駆使してるのが出てくるんですが、filterオプションというものがあるのでそれを使った方がスマートです。

docker 1.12時点のものです。

動いていないコンテナを消す

docker ps -aq -f status=exited -f status=dead | xargs docker rm

コンテナのステータスはこちら

  • created
  • restarting
  • running
  • paused
  • exited
  • dead

タグの付いてないイメージを消す

dangling<none>になってるイメージです。

docker images -f "dangling=true" -q | xargs docker rmi
28
23
0

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
28
23