alias d=docker alias dc=docker-compose alias dtop='d stats $(d ps --format={{.Names}})' alias ctop='d run -it --name ctop --rm -v /var/run/docker.sock:/var/run/docker.sock:ro quay.io/vektorlab/ctop:latest' alias dlog='d logs --follow --timestamps --tail=10000' dadopt() { local remote="$1" # Assumes your home directory has sane permissions, # in order to prevent other local users from gaining # effective root on the adopted machine local sock="$HOME/.cache/dadopt/$remote.sock" mkdir -p "$(dirname $sock)" unlink "$sock" ssh -nNT -L "$sock:/var/run/docker.sock" "$remote" & export DOCKER_HOST="unix://$sock" }