Docker批量删除容器/镜像(Docker batch delete container / image)

1、删除所有的容器

docker rm `docker ps -a -q`

2、删除所有的镜像

docker rmi `docker images -q`

提示:

-q参数:只显示容器ID

————————

< strong > 1. Delete all containers < / strong >

docker rm `docker ps -a -q`

< strong > 2. Delete all images < / strong >

docker rmi `docker images -q`

< strong > prompt: < / strong >

-Q parameter: display only container ID