Skip to content

Instantly share code, notes, and snippets.

@johndatserakis
Last active May 3, 2020 20:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johndatserakis/0002d9aded5778f9d0589a23ce1e08d4 to your computer and use it in GitHub Desktop.
Save johndatserakis/0002d9aded5778f9d0589a23ce1e08d4 to your computer and use it in GitHub Desktop.
Bash command to clean unused docker images and solve the max depth exceeded error.
# Getting a "max depth exceeded" error in your docker-compose file? Run these commands to clean our your docker install.
# Stop all running containers
docker stop $(docker ps -aq)
# Delete all docker containers
docker rm $(docker ps -a -q)
# Delete all docker images
docker rmi $(docker images -q)
# All commands at once
docker stop $(docker ps -aq) && docker rm $(docker ps -a -q) && docker rmi $(docker images -q)
# docker-compose down and removing volumes
docker-compose down -v --remove-orphans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment