Docker image cannot be removed


PS C:\Users\me> docker image ls
REPOSITORY   TAG       IMAGE ID       CREATED        SIZE
mysql        8.0       bf577825b52a   2 months ago   1.04GB
PS C:\Users\me> docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
PS C:\Users\me> docker image rm mysql
Error response from daemon: No such image: mysql:latest
PS C:\Users\me> docker image rmi mysql
Error response from daemon: No such image: mysql:latest
PS C:\Users\me>

How do I successfully remove the image?

Not sure anymore, does docker ps just display running containers ? (and not stopped ones)

My idea is that you’ve still a container based on that image.

(does ā€œdocker ps -allā€ exists ? I’m right now using my smartphone)

If you use code blocks instead of quotes to keep the original output, it is much easier to notice that you try to delete mysql:latest since you didn’t specify the version tag, but you only have mysql:8.0.

I formatted your post.

1 Like