Skip to content

Instantly share code, notes, and snippets.

@igorwwwwwwwwwwwwwwwwwwww
Last active April 15, 2016 18:00
Show Gist options
  • Save igorwwwwwwwwwwwwwwwwwwww/2a4f48768f3d52dba98ed19c8d2f1ffe to your computer and use it in GitHub Desktop.
Save igorwwwwwwwwwwwwwwwwwwww/2a4f48768f3d52dba98ed19c8d2f1ffe to your computer and use it in GitHub Desktop.
custom docker wrapper for osx
#!/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 "$@"
@Lyoness
Copy link

Lyoness commented Apr 15, 2016

😺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment