Created
December 24, 2019 17:57
-
-
Save alexpeits/595def951093c13f030522de1b5d2a8e to your computer and use it in GitHub Desktop.
This file contains 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
docker run -p 8080:80 mendhak/http-https-echo | |
curl http://localhost/whatever # works | |
# in another terminal | |
export hostmachine="$(docker network inspect --format='{{range .IPAM.Config}}{{.Gateway}}{{end}}' bridge)" | |
docker run --add-host hostmachine:$hostmachine --net=host -it debian bash | |
apt-get update && apt-get install -y curl | |
curl http://hostmachine:8080/whatever # I expect this to work |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment