aacebedo / dnsdock

DNS service discovery for Docker containers
MIT License
607 stars 92 forks source link

Container urls not resolving #92

Closed evancauwenberg closed 7 years ago

evancauwenberg commented 7 years ago

Hi!

First of all thnx for creating this little application!

I have followed the steps to build and run the dnsdock from source, when i start the application it seems to work:

[evancauwenberg@MacBook-Pro-van-Evert ~/go/bin]$ ★ sudo ./dnsdock -v 14:19:31.129 | DEBUG ▶ Handling DNS requests for 'docker'. 14:19:56.019 | DEBUG ▶ Started container 'b34830d018bd6228449dc3b4d7bb5d3945e1ea233b1f9c764da3283097357111' 14:19:56.030 | DEBUG ▶ Added service: 'b34830d018bd6228449dc3b4d7bb5d3945e1ea233b1f9c764da3283097357111': {api test [172.17.0.2] %!s(int=-1) [test.docker]}. 14:19:56.031 | DEBUG ▶ Handling DNS requests for 'test.docker'.

I have added also the following file in the /etc/resolver/ docker nameserver 172.17.0.2

But when i use dig .docker i don't receive the expected output: `[evancauwenberg@MacBook-Pro-van-Evert ~]$ ★ dig .docker

; <<>> DiG 9.8.3-P1 <<>> *.docker ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 1140 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION: ;*.docker. IN A

;; AUTHORITY SECTION: . 86392 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2017010700 1800 900 604800 86400

;; Query time: 22 msec ;; SERVER: 8.8.8.8#53(8.8.8.8) ;; WHEN: Sat Jan 7 14:23:36 2017 ;; MSG SIZE rcvd: 101`

Thnx in advance!

aacebedo commented 7 years ago

Hi ! Great that dnsdock is useful to you ! I am not the original creator of the app I just took over for the maintenace. I am currently working on issue #91 so it may take some time before I process this issue.

From what I see from your log you have set the address of the container you've spawned as a nameserver, however you've launch dnsdock on your host so you shall add 127.0.0.1 in your resolver file instead

evancauwenberg commented 7 years ago

Hi

Thnx for the quick response!

I have changed the nameserver to 127.0.0.1 and now i received the expected response, some debug output was dumped to!

I will try further, the url isn't working yet but i guess their is something wrong in the container itself.

Edit: still no succes, when i try to browse the urls i receive "ERR_NAME_NOT_RESOLVED"

Thnx in advance!

Kind regards Evert

aacebedo commented 7 years ago

I see that you are using a mac. Are you using docker toolbox or docker on mac ?

Another user had a network issue on mac because he was using docker on mac. What is happening when you do a ping ? Do you see the dns request when trying to access through your browser ?

evancauwenberg commented 7 years ago

Jeps i am working on a mac :)

this is the response from the ping request: [evancauwenberg@MacBook-Pro-van-Evert ~/Projects/milker]$★ ping test.docker ping: cannot resolve bamboo.docker: Unknown host

aacebedo commented 7 years ago

And when you execute dig with the address 127.0.0.1 are you receiving something? What are the log of dnsdock (started with -v flag)? Can you check issue #89 to be sure you don't have the same problem ?

evancauwenberg commented 7 years ago

` ★ dig 127.0.0.1

; <<>> DiG 9.8.3-P1 <<>> 127.0.0.1 ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 16964 ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION: ;127.0.0.1. IN A

;; AUTHORITY SECTION: . 80001 IN SOA a.root-servers.net. nstld.verisign-grs.com. 2017010900 1800 900 604800 86400

;; Query time: 27 msec ;; SERVER: 8.8.8.8#53(8.8.8.8) ;; WHEN: Mon Jan 9 11:35:29 2017 ;; MSG SIZE rcvd: 102 `

[evancauwenberg@MacBook-Pro-van-Evert ~/go/bin]$ ★ sudo ./dnsdock -v Password: 15:42:04.119 | DEBUG ▶ Handling DNS requests for 'docker'. 15:42:04.127 | DEBUG ▶ Added service: '6df47ae583568235ccd86ff094de8f782d28316aaf5c4e09902c13c80472871c': {temp_nginx_1 nginx [172.17.0.4] %!s(int=-1) [test.docker]}. 15:42:04.127 | DEBUG ▶ Handling DNS requests for 'test.docker'. 15:42:04.129 | DEBUG ▶ Added service: a2f43b78fec7105807457cb9bada2a19d2454d62cb594c1dd22c0568b3f5dd22': {temp_php_1 php [172.17.0.2] %!s(int=-1) []}. 15:42:04.131 | DEBUG ▶ Added service: 'af6d1f137eb50a131c1f6656f9fa24630f596779a014260828305ae2e0835a32': {temp_mysql_1 mysql [172.17.0.3] %!s(int=-1) [mysql.test.docker]}. 15:42:04.131 | DEBUG ▶ Handling DNS requests for 'mysql.test.docker'.

I will check issue 89 :)

evancauwenberg commented 7 years ago

`ERROR: for api Cannot start service api: invalid header field value "oci runtime error: container_linux.go:247: starting container process caused \"exec: \\"/app/docker/apache/run.sh\\": stat /app/docker/apache/run.sh: no such file or directory\"\n"

ERROR: for dnsdock Cannot start service dnsdock: driver failed programming external connectivity on endpoint test_dnsdock_1 (9886cba2805d1e91fb20c31e6ea152d8609e33ee5b2d978aa2649b7e6543901e): Error starting userland proxy: Bind for 172.20.200.1:53: unexpected error (Failure EADDRNOTAVAIL) ERROR: Encountered errors while bringing up the project.`

I have tried the solution given in #89 .. the only difference is that i'm using the native docker. https://www.docker.com/products/docker#/mac

aacebedo commented 7 years ago

Docker for Mac has some issues on the netwoking aspect. This bug is not related to dnsdock Please use a linux VM or switch to docker toolbox

evancauwenberg commented 7 years ago

Oooh oke, i will try that later today .. thnx for the quick response!

wclr commented 7 years ago

@evancauwenberg What command (or config) do you use to start dnsdock container?

@aacebedo nice to hear that you are working on the issues, waiting for the release.

evancauwenberg commented 7 years ago

@whitecolor .. tried it via docker-compose or just the native binary

./dnsdock

wclr commented 7 years ago

@evancauwenberg show your docker-compose config for launching service? With docker for mac/windows you need to map docker.sock: -v /var/run/docker.sock:/var/run/docker.sock

aacebedo commented 7 years ago

Closing the issue as no activity has been registered since one month