Docker Community Forums

Share and learn in the Docker community.

How do I remove unused containers?


(Nick Hazlett) #1

One method of removing unused containers is running:

  • docker rm $(docker ps -f status=exited -q -a)

For more information on the filtering flag see: https://docs.docker.com/reference/commandline/cli/#filtering_2


(Sam Saffron) #2

we use:

which is a bit more elaborate and removes stuff that finished more that 24 hours ago, giving you a buffer of sorts.