error when delete container image in django:Error response from daemon: conflict: unable to delete 7cc1942f1ed5 (must be forced)

created at 08-20-2021 views: 1

Don’t know if you have encountered it during your work.
docker reports an error when deleting the container image

docker rmi [container image ID]

error message

Error response from daemon: conflict: unable to delete 7cc1942f1ed5 (must be forced) - image is referenced in multiple repositories

try

  • First docker ps -a
    I saw several container images with the same ID, what the hell, it must be a mistake during the build.
  • Then stop the container using the container image (if it has been stopped, please go to the next step)
    docker stop [container image ID]
  • Then rm:
    docker rm [container image ID]
  • Then
    docker rmi [container image ID]

Found or reported an error

real solution

So good, the ultimate solution (this is the point of this article)

docker rmi -f [container image ID]
It is the above command with the -f parameter to force deletion of all container images with the container image ID

Please log in to leave a comment.