You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
User launches two apps with nanobox to test locally. Adds app1.com as alias for his first app. He wants to connect to it from his second app. Inside app 2, app1.com wouldn't resolve to his other application.
Solution
Utilize docker's --add-host when starting (run) the containers. If we only add to create, then we'd run into a destroy&recreate apps loop to try getting them updated ips.
Update to proposed solution
After some investigation/prototyping. It appears the best way to solve this (without running a DNS server and configuring the containers' resolv.conf to point to it) is in the hooks; configure maybe. The ExtraHosts is only available in container create and run (surprisingly it is not part of update), since we only create then start, we'd run into app1 not knowing about app2, but app2 knowing about app1. (unless perhaps the user adds all the dns aliases prior to running or deploy dry-running anything). Adding this to the hooks would have its own drawbacks however, as we would still likely want to preserve the original entries (which i believe come from the host's /etc/hosts file). Simplest way could be to just dump the hosts file contents into the payload for whatever hook we solve this with.
The text was updated successfully, but these errors were encountered:
glinton
added a commit
to nanobox-io/nanobox-hooks-code
that referenced
this issue
Sep 26, 2017
Use case
User launches two apps with nanobox to test locally. Adds
app1.com
as alias for his first app. He wants to connect to it from his second app. Inside app 2,app1.com
wouldn't resolve to his other application.Solution
Utilize docker's--add-host
when starting (run
) the containers. If we only add tocreate
, then we'd run into a destroy&recreate apps loop to try getting them updated ips.Update to proposed solution
After some investigation/prototyping. It appears the best way to solve this (without running a DNS server and configuring the containers'
resolv.conf
to point to it) is in the hooks; configure maybe. TheExtraHosts
is only available in containercreate
andrun
(surprisingly it is not part ofupdate
), since we onlycreate
thenstart
, we'd run into app1 not knowing about app2, but app2 knowing about app1. (unless perhaps the user adds all the dns aliases prior torun
ning ordeploy dry-run
ning anything). Adding this to the hooks would have its own drawbacks however, as we would still likely want to preserve the original entries (which i believe come from the host's/etc/hosts
file). Simplest way could be to just dump the hosts file contents into the payload for whatever hook we solve this with.The text was updated successfully, but these errors were encountered: