Using docker-gen with a Swarm cluster

TL;DR Using the latest version of docker-gen; connect it to the Swarm master (don’t forget SSL) and then use {{ $container.Node.Address.IP }} in your template files. docker-gen & Docker Swarm We will set up a Swarm cluster; in which nginx will be used as a reverse proxy to containers serving web content. docker-gen will monitor the swarm for relevant container starts and stops and update nginx accorrdingly. This in essense provides zero downtime for all container related maintenance. »

Using the docker-gen container with nginx as a reverse proxy: a practical example

Following on from the post using docker-gen stand alone in a docker container, we will now use the container in a more real world example. docker-gen will be used to generate configuration files for nginx to act as a reverse proxy for other docker containers serving web content. Purpose You have a set of Docker containers ready for serving web content; these could be either Apache, lighthttpd, hugo, something you have written yourself, or anything which understands HTTP and returns content. »

Running docker-gen stand alone in a Docker container

The 0.3.4 release of docker-gen now makes it easier to run docker-gen stand alone inside a Docker container. What is docker-gen docker-gen is tool which monitors Docker for events via Dockers remote API and then writes to a file according to a template. For example; we are interested in the events generated by Docker for when a container is created, deleted, started or stopped. Each event contains information relevant to the container which generated it. »