image is being used by stopped container

前端 未结 9 405
自闭症患者
自闭症患者 2021-01-30 05:08

I am trying to delete a docker container by this command:

docker rmi 

Obviously, I have replaced the Image-Id by the Id I get u

相关标签:
9条回答
  • 2021-01-30 05:28

    You must remove container first.
    Forced is the last method to take.

    #check container
    docker ps -a
    
    #remove container
    docker rm containerID
    
    0 讨论(0)
  • 2021-01-30 05:32

    You need to delete the stopped container with docker rm, and then you can delete the image it uses with docker rmi.

    0 讨论(0)
  • 2021-01-30 05:32

    Docker containers run on top of docker images, you can delete an image only if it is not attached to any container.! So you have to stop container and remove container then you can remove image id.

    docker stop container-id and docker rm container-id

    Then try removing image docker rmi image-id

    Some extra info given in below link. Cheers.!

    https://docs.docker.com/config/pruning/

    0 讨论(0)
提交回复
热议问题