image is being used by stopped container

前端 未结 9 716
自闭症患者
自闭症患者 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:25

    If the goal is to reclaim disk space, another approach not yet mentioned is to use docker system prune. It will print a warning which should be heeded:

    WARNING! This will remove:
      - all stopped containers
      - all networks not used by at least one container
      - all dangling images
      - all dangling build cache
    

    This will not delete named images, but will purge intermediate unnamed images. Depending on the sizes of containers you're using, this can save a considerable amount of disk space.

提交回复
热议问题