Last active
June 24, 2019 06:18
-
-
Save goldmann/31c64dcdc59c2c02c79a to your computer and use it in GitHub Desktop.
Docker aliases / helper function
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
alias dip="docker inspect -f '{{ .NetworkSettings.IPAddress }}'" | |
dssh() { | |
PID=$(docker inspect --format {{.State.Pid}} $1) | |
sudo /usr/bin/nsenter --target $PID --mount --uts --ipc --net --pid env -i - $(sudo cat /proc/$PID/environ | xargs -0) bash | |
} | |
drmiall() { | |
docker rmi `docker images -q -f dangling=true` | |
} | |
drmall() { | |
docker rm `docker ps -a -q` | |
} |
Most probably because I created these before Docker added support for this :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why not using docker rmi
docker images -q -f dangling=true
for drmiall ?