Skip to content

Instantly share code, notes, and snippets.

@atomkirk
Created February 9, 2021 14:25
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atomkirk/8e688dba9fb44ba372823c2820f5136e to your computer and use it in GitHub Desktop.
Save atomkirk/8e688dba9fb44ba372823c2820f5136e to your computer and use it in GitHub Desktop.
Stop all Docker containers

I will often run this command to make sure all my docker containers are stopped and removed before running docker-compose up. Sometimes when you restart your system, old containers will start back up automatically in the background.

docker stop $(docker ps -aq) && docker rm $(docker ps -aq)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment