docker删除镜像出现报错:image is being used by stopped container

1、如果删除时出现了image is being used by stopped container的错误就先使用一下命令再执行删除指令:

docker ps -a | grep "Exited" | awk '{print $1 }'|xargs docker stop
docker ps -a | grep "Exited" | awk '{print $1 }'|xargs docker rm
docker images|grep none|awk '{print $3 }'|xargs docker rmi

2、执行删除命令

docker rmi id(镜像id)

你可能感兴趣的:(linux,java,centos)