Last active
October 9, 2019 21:24
-
-
Save christianb/706b4dcc01e41764b250318fd297c48c to your computer and use it in GitHub Desktop.
Docker commands
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
# build with docker compose | |
docker-compose build | |
# run with docker-compose and open bash | |
docker-compose run --rm <image> /bin/bash | |
# Stop all Docker containers | |
docker stop $(docker ps -a -q) | |
# DANGER ZONE | |
# This will remove: | |
# - all stopped containers | |
# - all networks not used by at least one container | |
# - all dangling images | |
# - all dangling build cache | |
docker system prune | |
# DANGER: Removes all docker containers | |
docker rm $(docker ps -a -q) | |
# DANGER: Removes all images, even those images that are referenced in repositories | |
docker rmi $(docker images -q) --force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment