Skip to content

Instantly share code, notes, and snippets.

@munhitsu
Last active August 29, 2015 14:26
Show Gist options
  • Save munhitsu/e31d3458f50150efa59e to your computer and use it in GitHub Desktop.
Save munhitsu/e31d3458f50150efa59e to your computer and use it in GitHub Desktop.
docker snippets
# remove all containers (only if they are not running)
docker rm $(docker ps -aq)
# remove all containers (even if they are running)
docker rm -f $(docker ps -aq)
# remove all containers and their persistent volumes
docker rm -fv $(docker ps -aq)
# remove all images from docker host
docker rmi -f $(docker images -aq)
# attach to a running container
docker exec -it container_name bash
# get stdout logs from a container
docker logs container_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment