blob: bb8fc6da1669e6709e344a2ad3b0be816c49d2d7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
alias d=docker
alias dc=docker-compose
alias dm=docker-machine
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"
}
|