2
4

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イメージ削除時に Error: No such image

Posted at

不要なイメージを削除しようとしたらエラーが発生した。

$ docker images
REPOSITORY                 TAG                 IMAGE ID            CREATED             SIZE
<none>                     <none>              7236d7baccf7        24 hours ago        1.19GB
ruby                       2.6.1               99ef552a6db8        8 months ago        876MB

$ docker rmi 723
Error: No such image: 723

どうやら、リポジトリ+タグ で指定すると削除できるらしい。

$ docker rmi <none>:<none>
bash: syntax error near unexpected token `newline'

うん。ダメだよね、知ってた。
docker prune で消せるかな?

$ docker images prune
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE

$ docker images
REPOSITORY                 TAG                 IMAGE ID            CREATED             SIZE
<none>                     <none>              7236d7baccf7        24 hours ago        1.19GB
ruby                       2.6.1               99ef552a6db8        8 months ago        876MB

ダメかぁ・・・ docker system prune で削除してみる。

$ docker system prune
WARNING! This will remove:
        - all stopped containers
        - all networks not used by at least one container
        - all dangling images
        - all dangling build cache
Are you sure you want to continue? [y/N] y
Deleted Networks:
docker_default

Deleted Images:
deleted: sha256:476ecb9f768812b356cbb920474edbb9321d2d84739e47726d3a15bf7b448e2b


$ docker images
REPOSITORY                 TAG                 IMAGE ID            CREATED             SIZE
ruby                       2.6.1               99ef552a6db8        8 months ago        876MB

消せた!

ファイルシステムからイメージを削除しても消せるらしいけど、そちらは未検証。

2
4
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
2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?