Skip to content

Instantly share code, notes, and snippets.

@nyarla

nyarla/dockelly Secret

Last active June 22, 2016 09:40
Show Gist options
  • Save nyarla/8294369 to your computer and use it in GitHub Desktop.
Save nyarla/8294369 to your computer and use it in GitHub Desktop.
(OBSOLETED) This code is no longer maintenance
#!/usr/bin/env bash
address=192.168.20.129
running=`echo -n $(nmap ${address} -p 4243) | grep 'close' | grep '4243/tcp'`
if [ ! -z "${running}" ]; then
ssh docker@${address} <<EOF
sudo /usr/local/etc/init.d/docker stop
sudo sh -c "/usr/local/bin/docker -H tcp://${address}:4243 -d > /var/lib/docker/docker.log 2>&1 &"
exit
EOF
fi
export DOCKER_HOST=${address}
docker $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment