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$