Answers for "docker stop and remove all containers if they exist"

2

remove all docker containers

docker ps -aq
docker stop $(docker ps -aq)
docker rm $(docker ps -aq)
docker rmi $(docker images -q)
Posted by: Guest on March-10-2022
2

docker remove not running containers

docker container rm $(docker container ls –aq)
Posted by: Guest on October-30-2020

Code answers related to "docker stop and remove all containers if they exist"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language