Skip to content

Instantly share code, notes, and snippets.

@jacoelho
Created September 16, 2015 16:51
Show Gist options
  • Save jacoelho/90a7f5a732c1b4daac80 to your computer and use it in GitHub Desktop.
Save jacoelho/90a7f5a732c1b4daac80 to your computer and use it in GitHub Desktop.
docker-machine routing
#!/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