Created
June 29, 2018 11:15
-
-
Save Voronenko/5fb749b3c32052f8cbfe4be0a803c6a6 to your computer and use it in GitHub Desktop.
Temporary fallback host.docker.internal in custom containers #docker
This file contains hidden or 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
HOST_DOMAIN="host.docker.internal" | |
ping -q -c1 $HOST_DOMAIN > /dev/null 2>&1 | |
if [ $? -ne 0 ]; then | |
HOST_IP=$(ip route | awk 'NR==1 {print $3}') | |
echo -e "$HOST_IP\t$HOST_DOMAIN" >> /etc/hosts | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment