LoginSignup
32
24

More than 5 years have passed since last update.

Docker イメージ削除 'image has dependent child images' への対処

Last updated at Posted at 2017-08-08

Docker イメージが削除できない場合

現在の Docker イメージの確認

Inohana:~ inoko$ docker images
REPOSITORY               TAG                 IMAGE ID            CREATED             SIZE
test                   0.92                85303a1d447d        23 minutes ago      1.52GB
test                   0.91                405f9f4006e7        9 hours ago         1.48GB
centos                   <none>              328edcd84f1b        4 days ago          193MB
ubuntu                   latest              0ef2e08ed3fa        5 months ago        130MB

docker rmi コマンドでイメージ削除

  • コンフリクトエラーとなる。
Inohana:~ inoko$ docker rmi 405f9f4006e7
Error response from daemon: conflict: unable to delete 405f9f4006e7 (cannot be forced) - image has dependent child images
111
  • repository:tag で削除してみる。
Inohana:~ inoko$ docker rmi test:0.91
Error response from daemon: conflict: unable to remove repository reference "test:0.91" (must force) - container 55d3edcfa1ee is using its referenced image 405f9f4006e7
  • 消えていない。
Inohana:~ inoko$ docker images
REPOSITORY               TAG                 IMAGE ID            CREATED             SIZE
test                   0.92                85303a1d447d        24 minutes ago      1.52GB
test                   0.91                405f9f4006e7        9 hours ago         1.48GB
centos                   <none>              328edcd84f1b        4 days ago          193MB
ubuntu                   latest              0ef2e08ed3fa        5 months ago        130MB
  • 強制削除オプションを追加してみる。
Inohana:~ inoko$ docker rmi -f test:0.91
Untagged: test:0.91
  • 削除できた。
Inohana:~ inoko$ docker images
REPOSITORY               TAG                 IMAGE ID            CREATED             SIZE
test                   0.92                85303a1d447d        24 minutes ago      1.52GB
centos                   <none>              328edcd84f1b        4 days ago          193MB
ubuntu                   latest              0ef2e08ed3fa        5 months ago        130MB
Inohana:~ inoko$
32
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
32
24