ViktorOgnev
5/15/2015 - 2:07 PM

remove stopped containers and untagged images

remove stopped containers and untagged images

#!/bin/bash
# stop all
docker stop $(docker ps -a | awk '{print $1}')
# remove all containers
docker rm $(docker ps -a | awk '{print $1}')
# remove untagged images
docker rmi $(docker images -a | grep "^<none>" | awk '{print $3}')