- Remove stopped containers:
docker rm $(docker ps -a -q)
- Remove untagged images:
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')
- Remove unused images:
docker rmi $(docker images -q)
docker rm $(docker ps -a -q)
docker rmi $(docker images | grep "^<none>" | awk '{print $3}')
docker rmi $(docker images -q)