LoginSignup
22
24

More than 5 years have passed since last update.

WindowsのDockerで溜まったコンテナやイメージを削除する

Posted at

コマンドプロンプトのforが妙にむずいのでメモ.

停止中のコンテナをすべて削除する

コマンドプロンプト
for /f "usebackq" %x in (`docker ps -aq`) do docker rm %x

起動中のものを含むすべてのコンテナを削除する

コマンドプロンプト
for /f "usebackq" %x in (`docker ps -aq`) do docker rm -f %x

参照されていないイメージをすべて削除する

コマンドプロンプト
for /f "usebackq" %x in (`docker images -q`) do docker rmi %x
22
24
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
22
24