Okay, so I'm brand new to Docker and doing some tutorials and I want to delete the nginx
and mongo
images:
$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
nginx latest be1f31be9a87 12 days ago 109MB
mongo 3.4 598e8cf490a6 12 days ago 361MB
So I start with nginx
:
$ docker image rm nginx
Untagged: nginx:latest
Untagged: nginx@sha256:9ad0746d8f2ea6df3a17ba89eca40b48c47066dfab55a75e08e2b70fc80d929e
Deleted: sha256:be1f31be9a87cc4b8668e6f0fee4efd2b43e5d4f7734c75ac49432175aaa6ef9
Deleted: sha256:7609c40a03b852382a43d79231d9d4ca7661cd1ac9edcb46f78a44fff4ed59ca
Deleted: sha256:a2b6968c4326640dd5e9e22ddf6cebb61ba1a4b79a4ac8d194f93000c5a4c3e2
Deleted: sha256:8b15606a9e3e430cb7ba739fde2fbb3734a19f8a59a825ffa877f9be49059817
Has it gone?
$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
mongo 3.4 598e8cf490a6 12 days ago 361MB
So far so good. Now for mongo
:
$ docker image rm mongo
Error: No such image: mongo
Why didn't this work?
In the end I found that docker image rm 598e8cf490a6
did remove the mongo
image, but I still don't understand why this didn't work.
- What is that first column,
REPOSITORY
? Is that the image name, or something else? - If it is the image name, then why can't I delete the
mongo
image usingdocker image rm mongo
? - If it isn't the image name, then
- What is it?
- Why does
docker image ls
show it instead of the image name? - How do I get the actual image name? And specifically what is it? I also tried
docker image rm mongodb
anddocker image rm mongo-db
with no success.