Skip to content

Instantly share code, notes, and snippets.

@aburan28
Created February 22, 2017 13:22
Show Gist options
  • Save aburan28/49453942441827a404f2810ac4a38852 to your computer and use it in GitHub Desktop.
Save aburan28/49453942441827a404f2810ac4a38852 to your computer and use it in GitHub Desktop.
docker-compose build
# ...or just build one piece of it
docker-compose build [app|db|etc]
# Start your Docker Compose project
docker-compose up -d
# View the logs for this docker-compose proejct
docker-compose logs
# Stop running containers
docker-compose stop
# remove stopped containers
docker rm $(docker ps -a | grep Exited | awk '{print $1;}')
# or, to remove the stopped containers that were started by Docker Compose
docker-compose rm
# remove untagged images
docker rmi $(docker images -q --filter "dangling=true")
# Clean up dangling volumes
# (see the post below for how to install the python script)
sudo python docker_clean_vfs.py
# Better yet, remove dangling volumes before they're created by using -v
docker-composer rm -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment