7
6

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

Dockerイメージが「No such image」エラーで削除できない時

Last updated at Posted at 2018-09-27

TL;DR

なぜかError: No such image:と表示されて削除できない時、リポジトリ+タグ指定だと削除できました。

どゆこと?

あるはずのイメージが「ない」と言われる自体が発生。
もちろん -fも効かず。


# "docker_web"イメージを消し去りたい。
$ docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
docker_web          latest              dad996f63f1c        3 hours ago         1.14GB
ruby                2.3                 3d2218e08844        6 days ago          941MB
postgres            9.6                 c0b5c11b5690        2 weeks ago         229MB

$ docker rmi dad
Error: No such image: dad

$ docker rmi -f dad
Error: No such image: dad

(原因は、コンテナ起動中にディレクトリ動かしちゃったからです。爆)

リポジトリ+タグ指定でも削除可能

これは知らなかった。


$ docker rmi docker_web:latest
Untagged: docker_web:latest
Deleted: sha256:dad996f63f1c31bfde8e0b8974c8d385d97c163cef5d42342d6a09d0fe5da249
Deleted: sha256:c04b53411a5a03f4620e6b048d3414125f4f76d88dffd1692d296d370c9e32eb
Deleted: sha256:8460b75e11712750b82e8af96697c19c485335174a943353e3c685989bf21f6f
Deleted: sha256:e5785608340eafc8411dfbe082ed7500be3aac6b70c89e0df73de858e1dffe0d
Deleted: sha256:c507792db613a27ce6ea85cdd6a85e8fc6a8b4115f84d624eb33af437edfb819
Deleted: sha256:c5f575548ff6fff29eb7a64d8721882687d4d96d4f95c718a1e8022561761717
Deleted: sha256:d50557be0da8e2ada87a315c96b1a84b1f82733faa8477b325ed73cebde55a3d
Deleted: sha256:dca6f9e82fd4a2094908dbdbbe825e8db7b4c61e1479b38cd772f071c08ed283
Deleted: sha256:9cc3b4252bfde216b7d06f96aacccebc48fa459234992b3f8fce74846929ca44

さいごに

やさしく扱ってあげましょう←

7
6
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
7
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?