docker-examples
docker-examples copied to clipboard
Explore automatic host-to-container DNS resolution/routing
There are some interesting solutions to the problem of "how do I use friendly domain names that can be automatically/easily configured" with Docker containers. Some important background:
- Configure container DNS
- Tools like resolvable and docker-dnsmasq.
- Techniques like building your own Nginx, Varnish, or HAProxy-based reverse proxy for easier domain-to-container mappings.
- Amazee.io's approach: use dnsmasq, haproxy, and ssh-agent to connect things together.
Current approach to this is to manually use docker-gen (What https://github.com/jwilder/nginx-proxy uses). You can see it here: https://github.com/derimagia/docker-edge/blob/dab25d34b6123156756942395a17162fb1e16295/docker-entrypoint.sh#L6 - Only uses nginx but jwilder has one for haproxy as well (https://github.com/jwilder/docker-discover)
I wish I could find a way to automatically set up the host machine for development purposes to point to the servers, but I haven't looked too much into it yet. Let me if you find something better!
A link directly to docker-gen.