Docker: How to delete all local Docker images

后端 未结 16 2325
梦谈多话
梦谈多话 2021-01-29 17:24

I recently started using Docker and never realized that I should use docker-compose down instead of ctrl-c or docker-compose stop to get r

16条回答
  •  轮回少年
    2021-01-29 17:40

    Easy and handy commands

    To delete all images

    docker rmi $(docker images -a)
    

    To delete containers which are in exited state

    docker rm $(docker ps -a -f status=exited -q)
    

    To delete containers which are in created state

    docker rm $(docker ps -a -f status=created -q)
    

    NOTE: Remove all the containers then remove the images

提交回复
热议问题