-
-
Notifications
You must be signed in to change notification settings - Fork 654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Release v1.2.0: Auto DNS (breaking changes) #411
base: master
Are you sure you want to change the base?
Conversation
a03ac6b
to
58e3c9d
Compare
… to distinguish between PHP DNS queries and Host OS DNS queries
I am testing the autdns branch with:
I can use Virtual Hosts by editing the C:\Windows\System32\drivers\etc\hosts manually like: With Port Forwarding in the Virtualbox like: I can then call the devilbox with 127.0.0.1 and editing the hosts like: The autodns feature unfortunately has no effect with .env like:
This leads to:
|
@fkaminski thanks for the heads up. Looks like I will need to invest some work into this one. |
Hi, i am really not familar with the whole network administration stuff at all.
but did not get the autodns feature to work at all ... So if you need any further info to get it done with Docker Toolbox - Please let me know ... |
Finally get it worked with Docker Toolbox: A fresh Installation of Docker Toolbox v18.09.0 with "Virtualbox NDIS6 Bridged Networking Driver" ( which is the default installation option ) and Windows 7 ( Windows 10 Home not yet tested ). After further setup via "Docker Quickstart Terminal" you get a "default" VM with "Network Adapter 1" as "NAT" and "Network Adapter 2" as "Host-only Adapter" per default in Virtualbox. My Docker Machine IP is: 192.168.99.100 ( docker-machine ip ) Then: Set the docker machine IP ( here 192.168.99.100 ) as preferred DNS IP in the "Virtualbox Host-Only Network #2" Adapter - see Screen: After that i restart my computer and do a "ipconfig /flushdns" in the Windows CMD - just for shure. Then with GitBash in the devilbox folder:
and the following entries in the .env:
Then:
With Chrome Browser head to http://192.168.99.100: the virtual host can be reached: Furthermore: If we setup port forwarding in the Virtualbox "NAT Adapter" like: we can also browse http://127.0.0.1 for the devilbox web interface and the virtual hosts work as well ... |
@fkaminski awesome I will add this to the documentation for this feature! |
58e3c9d
to
94c54a2
Compare
A little bit confusing: But this leads me only to the devilbox webinterface. To use the virtual host there, i had to edit the host file on that computer accordingly. |
To be not misunderstood. There are two options with Docker Toolbox:
OR
But how can I reach the virtual hosts in my local LAN with a mobil device now? On another Laptop within my LAN i can reach the devilbox webinterface by IP. And when i edit the host file on that Laptop manually i can also reach the corresponding virtual hosts. How can i reach the virtual hosts by hostname with a mobil device without using public services like ngrok (#453)? Maybe you have some hints on that ... |
Once AutoDNS feature is merged, it should be as simple as:
|
Hm, In meinem privaten Netzwerk: Desktop-A:
Desktop-B / Mobil-Device:
Um Router/Firewall Probleme ausschließen zu können habe ich testweise ( Ohne docker-machine start ) die portable Version von Acrylic DNS Proxy auf Desktop-A gezogen und für *.loc konfiguriert/gestartet. Im Anschluß funktioniert lokal ( auf Desktop-A ) ping 123.loc/ping 345.loc etc.. Dann habe ich testweise ( ohne devilbox ) nur docker-bind gestartet mit:
Auf Desktop-A funktioniert ping 123.loc/ping 345.loc etc.. Nur in Verbindung mit Virtualbox/docker-toolbox ( docker-machine ) bekomme ich keine Auflösung der TLD's im privaten Netzwerk hin ... Also unabhängig von den devilbox "docker-volumes"/"autodns" branches, komme ich hier nicht weiter... |
I am currently still investigating different approaches. I might as well add DNS functionality directly into the PHP-FPM container, so that it will always resolve the web server in case you e.g.: curl (from inside the container) a project. This would probably be less error prone. The v1.0.0-alpha1 release will therefore be without the new autodns feature, so that I can start moving forward without being blocked by this one. |
bf50d2b
to
937e80a
Compare
b8a7208
to
7539a16
Compare
73dcb0d
to
fa9631a
Compare
1bab8ef
to
ebaafd9
Compare
5c1baaf
to
57b2a5c
Compare
@fkaminski thanks again for the troubleshooting! I have moved out the AutoDNS feature from v1.0.0 into v1.1.0 and will tackle it in a slightly different approach: In the first step, I will integrate a DNS server directly into the PHP container so that this will work without external dependencies and point everything automatically to the webserver (or configurable also to varnish or haproxy - depending on the need). Then the only configuration that needs to be taken care of is the current Once that is all tackled and proven stable, I will reconsider moving the PHP container integrated DNS server out for modularity. |
AutoDNS
READFIRST
This branch is constantly being rebased from
master
until final merge, therefore requires git force pushing. Keep this in mind when checking it out via git.Feedback
To move on faster and pain-free, please try out this branch and provide your Feedback. I will update the description correspondingly.
DESCRIPTION
This PR splits the currently called DNS container
bind
into two separate containers:intdns
andautodns
intdns (required to run)
The
intdns
container will only be responsible to handle DNS queries internally for the PHP container, directing all queries to the Devilbox HTTP server. This container must always run in order to be able to resolve virtual hosts from within the PHP container (e.g.curl https://project1.loc
).autodns (optional)
The
autodns
container will be responsible to take care about the DNS for your host operating system. Previously all queries resolved to127.0.0.1
by default. This however did not work for legacy solutions such as Docker Toolbox. In order to mitigate this issue, this container has been made configurable to specify the IP address where the Devilbox is serving the virtual hosts. For native solutions this is set to127.0.0.1
by default. If you're using Docker Toolbox, you can set this value to192.168.99.100
via the.env
file for instance:State
This PR is currently WIP, but already usable if you want to try it out. There are however still a few things that need to be addressed before this can be released.
Todo
127.0.0.1
into the PHP container will not be required any more)Important
Once you're using this feature, you should not rely on any services being bound to
127.0.0.1
on the PHP container anymore. You should from now on either:The second option is anyhow much better in case you decide for example to use a database outside the Devilbox docker environment. Then you will only have to adjust the
.env
variable and you're all set.Benefits
Other benefits will include for easier DNS resolution inside the LAN. (e.g. access the Devilbox from various devices: mobiles, tablets, other computers without having to change a lot, even easier usage as a staging or prod server - if u intend to do so)