summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--conf.d/99-docker.zsh9
1 files changed, 7 insertions, 2 deletions
diff --git a/conf.d/99-docker.zsh b/conf.d/99-docker.zsh
index 903e2bb..bb8fc6d 100644
--- a/conf.d/99-docker.zsh
+++ b/conf.d/99-docker.zsh
@@ -8,9 +8,14 @@ alias dlog='d logs --follow --timestamps --tail=10000'
dadopt() {
local remote="$1"
- local sock="/tmp/$remote.sock"
+
+ # 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" &
- chmod og-rwx "$sock"
export DOCKER_HOST="unix://$sock"
}