Last active
April 15, 2016 18:00
-
-
Save igorwwwwwwwwwwwwwwwwwwww/2a4f48768f3d52dba98ed19c8d2f1ffe to your computer and use it in GitHub Desktop.
custom docker wrapper for osx
This file contains 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 | |
if [ "$(docker-machine status)" = "Stopped" ]; then | |
docker-machine start | |
fi | |
eval "$(docker-machine env)" | |
if ! route -n get 172.17.0.0/16 | grep 'destination: 172.17.0.0' > /dev/null; then | |
echo "adding route for docker prefix 172.17.0.0/16" | |
sudo route -n add 172.17.0.0/16 $(docker-machine ip) | |
fi | |
/usr/local/bin/docker "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
😺