typicode / hotel

🏩 A simple process manager for developers. Start apps from your browser and access them using local domains
MIT License
9.98k stars 424 forks source link

Resolving http requests to hotel from within a docker container #249

Open airtonix opened 6 years ago

airtonix commented 6 years ago

workstation

#  in alpine-node:6.10.0 container
$ curl http://concourse.dev
curl: (7) Failed to connect to concourse.dev port 80: Connection refused
$ nslookup concourse.dev
nslookup: can't resolve '(null)': Name does not resolve

Name:      concourse.dev
Address 1: 127.0.53.53

My other option isn't that great: running a dnsmasq container, change my wifi interface dns settings in windows 10 to statically point at the mobyvm, then manage dns records with dnsmasq.

airtonix commented 6 years ago
~ $ docker run --rm -it alpine /bin/sh
Unable to find image 'alpine:latest' locally
latest: Pulling from library/alpine
2fdfe1cd78c2: Pull complete
Digest: sha256:ccba511b1d6b5f1d83825a94f9d5b05528db456d9cf14a1ea1db892c939cda64
Status: Downloaded newer image for alpine:latest
/ # HTTP_PROXY=http://192.168.0.102 curl concourse.dev
/bin/sh: curl: not found
/ # apk --update add curl
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
(1/4) Installing ca-certificates (20171114-r0)
(2/4) Installing libssh2 (1.8.0-r2)
(3/4) Installing libcurl (7.57.0-r0)
(4/4) Installing curl (7.57.0-r0)
Executing busybox-1.27.2-r6.trigger
Executing ca-certificates-20171114-r0.trigger
OK: 6 MiB in 15 packages
/ # HTTP_PROXY=http://192.168.0.102 curl concourse.dev
curl: (7) Failed to connect to concourse.dev port 80: Connection refused
/ # HTTP_PROXY=http://192.168.0.102:2000/proxy.pac curl concourse.dev
curl: (7) Failed to connect to concourse.dev port 80: Connection refused
/ # HTTP_PROXY=http://192.168.0.102:2000 curl concourse.dev
curl: (7) Failed to connect to concourse.dev port 80: Connection refused
tmaier commented 6 years ago

You must start the container already with the proxy configuration.

Please see https://docs.docker.com/network/proxy/

If this works, please consider to add a section to the README or the wiki.