Last active
August 29, 2015 14:26
-
-
Save munhitsu/e31d3458f50150efa59e to your computer and use it in GitHub Desktop.
docker snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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