summaryrefslogtreecommitdiff
path: root/conf.d/99-docker.zsh
diff options
context:
space:
mode:
authorTill Höppner2017-06-05 18:37:13 +0200
committerTill Höppner2017-06-05 18:37:13 +0200
commitae50dcd19349bccf3727b76ae6d87c2c61df534f (patch)
tree37b9ed68d322e40a4f44596d2247d452274e09b3 /conf.d/99-docker.zsh
parentdae072cd503cc51c5429db7c015f393af30f37d3 (diff)
downloadzsh-ae50dcd19349bccf3727b76ae6d87c2c61df534f.tar.gz
zsh-ae50dcd19349bccf3727b76ae6d87c2c61df534f.tar.xz
zsh-ae50dcd19349bccf3727b76ae6d87c2c61df534f.zip
Create socket in ~ instead of /tmp
Diffstat (limited to 'conf.d/99-docker.zsh')
-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"
}