Last active
August 31, 2015 09:20
-
-
Save cedricvidal/a7365160a9efb8ba066e to your computer and use it in GitHub Desktop.
Configure remote docker over SSH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HOST=user@host | |
# Make sure socat is installed on remote before starting tunnel | |
ssh $HOST socat -V | grep "socat version" | cat 1>&2 | |
# Start tunnel | |
echo "starting tunnel" 1>&2 | |
(socat "UNIX-LISTEN:/tmp/$HOST-docker.sock,reuseaddr,fork" "EXEC:'ssh -kTax $HOST socat STDIO UNIX-CONNECT\:/var/run/docker.sock'" 2>&1 | >&2 xargs echo) & | |
# Tell docker | |
echo export DOCKER_HOST=unix:///tmp/$HOST-docker.sock |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment