Error response from daemon: conflict:
unable to remove repository reference "ubuntu" (must force) -
container c880076398dc is using its referenced image 8847e9bf6df8
If you try to remove a docker image using docker rmi command and you get the above error, because, either there is a container with this docker image still running, or it is in EXITED state.
Fix:You will need to stop and remove the container that you created from the image before you can remove the image.
Run the docker ps -a command to see the containers,
% docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c880076398dc fedora "/bin/bash" 54 minutes ago Up 54 minutes brave_archimedes
Now first stop the container that is still referenced, c880076398dc in my case.
% docker stop c880076398dc
c880076398dc
Now first remove the container that is still referenced, c880076398dc in my case.
% docker rm c880076398dc
c880076398dc
Now you should be able to remove the image,
% docker rmi ubuntu
Untagged: ubuntu:latest
Untagged: ubuntu@sha256:cbf627299e327f564233aac6b97030f9023ca41d3453c497be2f5e8f7762d185
Deleted: sha256:8847e9bf6df80d7720e7daa5788671263f03a108a19cff8ff8c6f5f17fcad348
Deleted: sha256:e70c785847f52e4401c2cb812a809feaeee7c55d385dbb575db82288c7d41f76

Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!