bioatlas / ala-docker

Dockerized version of Atlas of Living Australia components
GNU Affero General Public License v3.0
12 stars 12 forks source link

Make use of dockers embedded DNS #6

Closed mskyttner closed 7 years ago

mskyttner commented 7 years ago

It would be nice if the setup uses Docker embedded DNS capabilities. If we have container 1 and container 2 (c1, c2) running in the host, can c2 ping c1 under the name "gbifsweden.se" resolved locally by the embedded Docker DNS capabilities?

The container needs to "see" and resolve the hostname used. That can be tested with "ping" for example. If this doesn't work from inside the container, then there is a problem.

Perhaps https://docs.docker.com/engine/userguide/networking/default_network/configure-dns/ can provide instructions on how to make the container see itself under a given hostname?

What about --link or --hostname and the docker compose equivalents, whatever those might be?

Perhaps extra_hosts or external_links? It seems you can do this in docker-compose.yml:

domainname: foo.com hostname: foo

Details: https://docs.docker.com/compose/compose-file/#/cpu-shares-cpu-quota-cpuset-domainname-hostname-ipc-mac-address-mem-limit-memswap-limit-privileged-read-only-restart-shm-size-stdin-open-tty-user-working-dir

mskyttner commented 7 years ago

@shahmanash, please have a look at mskyttner/dns-docker-test, could it be a solution for this?