Last active
February 19, 2019 01:18
-
-
Save parmindersk/976d26fcbeac61963da74ca21e8bf19f to your computer and use it in GitHub Desktop.
Shortcut commands for docker
This file contains 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 exited instances | |
alias drm="docker ps -a | grep 'Exit\|Created' | cut -d ' ' -f 1 | xargs docker rm" | |
# View Network details | |
alias dinw="docker network inspect bridge" | |
# List images | |
alias dlsi="docker images" | |
# List containers | |
alias dpsa="docker ps -a" | |
# Remove given image | |
dirm(){ docker image rm $1 --force; } | |
# Bash into a container | |
dexec(){ docker exec -it $1 bash; } | |
# Stop docker container | |
dstop(){ docker stop $1; } | |
# Stop and remove | |
dstopr(){ docker stop $1; docker rm $1; } | |
# Start container | |
dstart(){ docker start $1; } | |
# Pull a docker image | |
dpull(){ docker pull $1; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment