Skip to content

Install Docker dynamic DNS

Christophe Labouisse edited this page May 29, 2015 · 1 revision

Step by step installation of Docker dynamic DNS updater

Preliminary

Before attempting to install docker-ddns.py you should ensure you have a properly running bind9 configured for dynamic update. Check this page for a quick how-to.

Script installation

First you have to install python3 and pip3. On a Debian based distro the command should be:

sudo apt-get install python3 python3-pip

Then to install the dependencies you have to use pip3:

sudo pip3 install -r requirements.txt

You can copy dockerDDNS.py in the right directory:

sudo cp dockerDDNS.py /usr/local/bin

Configuration

Configuration files are provided in the upstart directory:

sudo cp upstart/docker-ddns.conf /etc/init
sudo cp upstart/docker-ddns /etc/default
sudo initctl reload-configuration

Before launching the service edit /etc/default/docker-ddns to change the key to use to update the container zone.

Test it

Start the daemon:

sudo service docker-ddns start

Start a containers:

docker run -ti --name test-dns --rm debian:jessie /bin/bash

And while the container is running check the ip from another shell:

host test-dns.containers 127.0.0.1

After stopping the container the host should not be able to be found.