Remove non-running Docker containers
Docker lacks a "clean" command, but you can easily cleanup unused containers by running this script. Note: This will remove any non-running containers.
docker ps -a | cut -c-12 | xargs docker rm
Read more here: https://github.com/dotcloud/docker/issues/928
Written by Nathan Hopkins
Related protips
2 Responses
This will remove ALL containers
over 1 year ago
·
Running this command sufficient enough, or is this a better alternative to:
$ docker system prune -a
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Devops
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#