Skip to content

Instantly share code, notes, and snippets.

@xcsrz
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xcsrz/f48fb343e7fedb66e74d to your computer and use it in GitHub Desktop.
Save xcsrz/f48fb343e7fedb66e74d to your computer and use it in GitHub Desktop.
If you run into a situation where you have thousands or tens of thousands of dead containers and you run the usual docker rm `docker ps -a -q` either docker will bomb saying too many arguments or you'll see that as the list of containers being killed grows the process slows down. It seems the docker process amasses all the open files until it's …
while [[ `docker ps -a -q | wc -l` -gt `docker ps -q | wc -l` ]]; do docker rm ` docker ps -a -q | head -n 25`; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment