Skip to content

Instantly share code, notes, and snippets.

@goldmann
Last active Jun 24, 2019
Embed
What would you like to do?
Docker aliases / helper function
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`
}
@vaceletm
Copy link

vaceletm commented Sep 10, 2014

Why not using docker rmi docker images -q -f dangling=true for drmiall ?

@goldmann
Copy link
Author

goldmann commented Sep 11, 2014

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