Last active
January 6, 2020 10:58
-
-
Save odellt/450c5738d091e5f2a47cc07ceab2545a to your computer and use it in GitHub Desktop.
Helper commands for docker management
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
#! bin/sh | |
# Docker Helpers | |
# List all containers by ID | |
docker ps -aq | |
# Stops all docker containers | |
docker stop $(docker ps -aq) | |
# Remove all containers | |
docker rm $(docker ps -aq) | |
# Remove all images | |
docker rmi $(docker images -q) --force | |
# Removes all unused images and volume | |
docker system prune --all --volumes --force | |
# Opens a shell inside a running docker container | |
docker exec -it [DOCKER CONTAINER NAME] /bin/sh | |
# Builds an image using the DockerFile in the current directory | |
docker build -t [DESIRED CONTAINER NAME] . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment