Yes if you try to remove an image and a running container exists, rmi command will not be a success.
BUT you can force a remove image command :-) :
$ docker rmi ubuntu:latest Error response from daemon: conflict: unable to remove repository reference "ubuntu:latest" (must force) - container 988cb10f88b8 is using its referenced image f643c72bc252
$ docker rmi ubuntu:latest --force Untagged: ubuntu:latest Untagged: ubuntu@sha256:c95a8e48bf88e9849f3e0f723d9f49fa12c5a00cfc6e60d2bc99d87555295e4c
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yes if you try to remove an image and a running container exists, rmi command will not be a success.
BUT you can force a remove image command :-) :
$ docker rmi ubuntu:latest
Error response from daemon: conflict: unable to remove repository reference "ubuntu:latest" (must force) - container 988cb10f88b8 is using its referenced image f643c72bc252
$ docker rmi ubuntu:latest --force
Untagged: ubuntu:latest
Untagged: ubuntu@sha256:c95a8e48bf88e9849f3e0f723d9f49fa12c5a00cfc6e60d2bc99d87555295e4c