Skip to content

Commit

Permalink
Merge pull request qoomon#1 from jchapuis/master
Browse files Browse the repository at this point in the history
added support for macOS
  • Loading branch information
qoomon authored Mar 7, 2018
2 parents 76010cd + 9e6ecfe commit e86273d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
set -e

GATEWAY=$(ip route | grep '^default' | cut -d' ' -f3)

# mac specific docker gateway
GATEWAY_MAC="$(getent hosts docker.for.mac.host.internal | cut -d' ' -f1)"
if [ -z "$GATEWAY_MAC" ]; then
GATEWAY=$GATEWAY_MAC
fi

echo "Docker Host Gateway: $GATEWAY"

iptables -t nat -I PREROUTING -p tcp --match multiport --dports "${PORTS:-'0:65535'}" -j DNAT --to-destination ${GATEWAY}
Expand Down

0 comments on commit e86273d

Please sign in to comment.