While setting up a new build machine (CentOS 7, Docker CE 17.12.0-ce), I did a simple test:
docker run -it --rm ubuntu bash
Which worked fine, but now I can't remove the Ubuntu image.
[build ~]$ docker image rm ubuntu
Error: No such image: ubuntu
[build ~]$ docker image rm ubuntu:latest
Error: No such image: ubuntu:latest
[build ~]$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 0458a4468cbc 24 hours ago 112MB
[build ~]$ docker rmi 0458a4468cbc
Error: No such image: 0458a4468cbc
It's not being used by any containers (not that that's the error anyway):
[build ~]$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
[build ~]$
I even tried the nuke-from-orbit approach:
[build ~]$ docker rmi $(docker images -q)
Error: No such image: 0458a4468cbc
And restarting the docker daemon:
[build ~]$ sudo systemctl restart docker
[build ~]$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 0458a4468cbc 24 hours ago 112MB
[build ~]$ docker rmi 0458a4468cbc
Error: No such image: 0458a4468cbc
What gives? Not that it really matters that the ubuntu image is there, I just don't understand why I can't clean it up.
Update
I tried pulling the image again, and, well:
docker pull ubuntu
Using default tag: latest
latest: Pulling from library/ubuntu
Digest: sha256:e27e9d7f7f28d67aa9e2d7540bdc2b33254b452ee8e60f388875e5b7d9b2b696
Status: Downloaded newer image for ubuntu:latest
[build ~]$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 0458a4468cbc 25 hours ago 112MB
ubuntu latest 0458a4468cbc 25 hours ago 112MB
[build ~]$ docker image rm ubuntu
Untagged: ubuntu:latest
[build ~]$ docker image ls
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu latest 0458a4468cbc 25 hours ago 112MB
[build ~]$
Update 2
Tried the same basic steps with a brand new CentOS 7 1708 install and had no problems at all, so safe to say this is just a weird one-off corruption of something on this machine.
Question still is, how do I clean it up? Is there something on the filesystem I can just rm -rf and let docker start fresh?
docker imagesinstead ofdocker image ls, I don't think there would be a difference though.docker info -f '{{ .Driver }}'Have you tried pulling the ubuntu image again?devicemapper. Runningdocker imagesshows the same asdocker image ls.overlay2, but with the same problem.