arun-gupta / docker-java

Docker for Java Developers
386 stars 230 forks source link

dockerlab hostname failed to resolv when connected to VPN #58

Closed rafabene closed 8 years ago

rafabene commented 9 years ago

When the computer is connected to the VPN, the dockerlab host is always resolving to 198.105.254.228 This is not overwritten by docker when the host is added to /etc/hosts file. (It seems that docker always use resolv.conf).

We should change the dockerlab host to something like instructor.classroom.com, or other suggestions are welcomed

arun-gupta commented 9 years ago

Does it work correctly with no VPN?

A more basic question ... will attendees have visibility into the IP addresses created on instructor's machine anyway?

pmuir commented 9 years ago

Docker is a bit odd about it's DNS usage. I've found it more reliable to have real DNS in use, not /etc/hosts

arun-gupta commented 9 years ago

How would you recommend setting it up? Recommendations from docker-jboss-eap lab?

pmuir commented 9 years ago

Provide a real DNS server with a real DNS entry. Unfortunately I don't have a solution right now. I tried to add a DNS server to our instructor lab (so that all you do is change your host DNS to use this) BUT I can't make it work atm.

For now I've told people using docker-jboss-eap outside of the lab machine env to set up a DNS server - not a good solution, but atm it's not an issue for us as it's only testers who see it, not lab participants.

arun-gupta commented 9 years ago

Everything is pre-populated for docker-jboss-eap lab. How do you recommend this would work in BYOL cases?

pmuir commented 9 years ago

Well, I guess you have some server (which is dockerlab)? So then run a DNS server there in a docker container.

arun-gupta commented 9 years ago

dockerlab is a docker machine on instructor's machine, that's how @rafabene and @myfear setup the lab. Didn't realize those machines may not be accessible to attendees. What do you think?

rafabene commented 9 years ago

I'm working on that. I'll make the assumption that the instructor will setup the host locally and the attendees are on a remote host (as expected)

arun-gupta commented 9 years ago

Great, thanks @rafabene!

rafabene commented 9 years ago

One possible solution is to use IP instead of names. If we want to use names I may try to use run a DNS server docker container. Wdyt ?

arun-gupta commented 9 years ago

Lets include a DNS server container as that would keep the lab content clean, and would not require change every time.

rafabene commented 9 years ago

Ok. Tks

rafabene commented 9 years ago

Running DNS as docker container (dnsmasq, bind, etc) seems to be also problematic. docker-machine (VirtualBox) doesn't allow port forwarding for privileged ports (<1024). Having DNS server running on other ports can cause issues with many different clients. The solution will be to install dnsmasq locally.

arun-gupta commented 9 years ago

Can you provide instructions for the same?

rafabene commented 9 years ago

Maybe for Linux and Mac. I'll need someone to make the Windows instructions

arun-gupta commented 9 years ago

Those two would be enough for now, and then you can assign the issue to @myfear :-)

rafabene commented 9 years ago

The last commit should fix the the DNS issue. I also changed it to classroom.example.com to follow the pattern used by redhat training.

I can go deeper on the dnsmasq installation instruction once that these setup is validated.

Note that it was a big change and it should be good if all the lab can be validated again.

arun-gupta commented 9 years ago

@rafabene Installed brew install dnsmasq, what else needs to be done?

rafabene commented 9 years ago

I've used this instruction for dnsmasq: http://passingcuriosity.com/2013/dnsmasq-dev-osx/

arun-gupta commented 9 years ago

@rafabene is this relevant any more? #61 should take care of it, right?

arun-gupta commented 9 years ago

@rafabene any thing else needs to be done on this, or can it be closed?

arun-gupta commented 8 years ago

Closing the issue as there is no response from user and cannot reproduce it any more.