I’m relatively new to nearly everything with web development, but I’ve been playing around with Docker recently. While my local environment is basically a bunch of Docker images interconnected, my actual production environment is going to spread out among multiple servers so I can better load balance and scale.

My question is, docker allows you to use the name of the docker image as a stand-in for IP addresses, since it has an internal DNS server that will resolve them to the correct IP on the subnet.

For example, using redis:6379 instead of [redis server IP]:6379 because internally, ‘redis’ resolves automatically to the correct private IP via Docker’s DNS.

So what I’m wondering is, does Digitalocean offer an inbuilt functionality for something like this? Or will I have to host my own DNS server for my droplets that redirects to their private IP’s as needed?
Thanks

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hey!

What you are looking for is a service discovery tool like Hashicorp’s Consul [1] or Netflix’s Eureka [2].

If you’re using Kubernetes, you can reference their services using a DNS [3].

If you’re using Hashicorp’s Nomad, it comes with Consul integration built in [4].

[1] https://www.consul.io/use-cases/service-discovery-and-health-checking
[2] https://github.com/Netflix/eureka
[3] https://kubernetes.io/docs/concepts/services-networking/dns-pod-service
[4] https://www.nomadproject.io/docs/integrations/consul-integration/

Submit an Answer