0
1

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 3 years have passed since last update.

Dockerのイメージとコンテナ削除

Last updated at Posted at 2021-02-20

はじめに

不要なイメージとコンテを一括削除する際のメモ。

参考:
https://docs.docker.com/config/pruning/

イメージ削除

コンテナから参照されていない且つタグがついていないイメージを一括削除
$ docker image prune
同じリポジトリ名のイメージを一括削除
docker rmi -f `docker images リポジトリ名 -q`

オプション

オプション 説明
--all, -a 未使用のイメージをすべて削除
--filter 条件指定。例: "until=24h"
--force, -f 確認無しで即時削除

コンテナ削除

停止状態のコンテナを一括削除
$ docker container prune
0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?