Created
September 16, 2015 16:51
-
-
Save jacoelho/90a7f5a732c1b4daac80 to your computer and use it in GitHub Desktop.
docker-machine routing
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
#!/bin/bash | |
DOCKER_NETWORK=$(docker-machine ssh dev "ip route show" | awk '/docker0/{print $1}') | |
DOCKER_HOST=$(docker-machine ip dev) | |
sudo bash <<EOF | |
route -n delete "${DOCKER_NETWORK}" "${DOCKER_HOST}" || true | |
route -n add "${DOCKER_NETWORK}" "${DOCKER_HOST}" | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment