Loading Blog Search...

Wednesday, January 13, 2021

docker compose to remote host

# setup
ssh -nNT -L /tmp/socket.remote:/var/run/docker.sock user@remote.example.com &
export TUNNEL_PID=$!
export DOCKER_HOST=unix:///tmp/socket.remote

# use docker, docker-compose here
docker-compose…


# shutdown and cleanup of the socket
kill $TUNNEL_PID
rm -f /tmp/socket.remote

No comments: