How do I remove unused containers?

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

1 Like

we use:

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