Skip to content

Instantly share code, notes, and snippets.

@longshorej
Created June 9, 2016 23:57
Show Gist options
  • Save longshorej/c34c99c55a1f0c881d88e5eda3397d67 to your computer and use it in GitHub Desktop.
Save longshorej/c34c99c55a1f0c881d88e5eda3397d67 to your computer and use it in GitHub Desktop.
docker containers access docker host via /etc/hosts
#!/bin/bash
set -e
HPN_DOCKER_HOST=`/sbin/ip route | awk '/default/ { print $3 }'`
echo "$HPN_DOCKER_HOST docker" >> /etc/hosts
# exec ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment