Skip to content

Instantly share code, notes, and snippets.

@bdelacretaz
Last active August 29, 2015 14:05
Show Gist options
  • Save bdelacretaz/e8c75446918968bd7678 to your computer and use it in GitHub Desktop.
Save bdelacretaz/e8c75446918968bd7678 to your computer and use it in GitHub Desktop.
How to let Docker containers running with boot2docker know the host mac's IP address
$ curl http://localhost:8000/works.txt
ok works
$ export IP=$(boot2docker ssh "set | grep SSH_CLIENT" | cut -d"'" -f2 | cut -d" " -f1)
$ docker run -e HOST_MAC=$IP busybox sh -c 'wget -q -O - http://$HOST_MAC:8000/works.txt'
ok works
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment