Skip to content
This repository has been archived by the owner on Oct 5, 2018. It is now read-only.

openwide-java/docker-listen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Discontinued

This repository is no longer actively maintained. Please take a look at mveyrenc's fork or shavounet's fork.

Intro

docker-listen provides automatic dnsmasq hosts configuration update on docker run and stop events.

Installation

docker-listen relies on following dependencies :

  • dpath
  • docker-py

You can install these dependencies by your regular packaging system.

Otherwise, you can use virtualenv and pip to prepare an isolated python env :

virtualenv docker-listen-pyenv
./docker-listen-pyenv/bin/pip install dpath
./docker-listen-pyenv/bin/pip install docker-py

<python> refers to an interpreter loaded with needed dépendencies.

Running

Run the following command :

sudo <python> docker-listen.py

pex enables one-line install / run :

sudo pex dpath docker-py -- docker-listen.py

WARN : /etc/dnsmasq.d/docker-* will be cleared each time process is started.

WARN : sudo is required so that docker-listen can force dnsmasq to reload hosts (with a SIGHUP process signal)

Running as a service

Using upstart

Copy the file upstart/docker-listen.conf in /etc/init.

Configure the path to docker-listen in /etc/init/docker-listen.conf and start the service with service docker-listen start.

Using Systemd

Copy the file systemd/docker-listen.service in /etc/systemd/system.

Copy the file systemd/docker-listen in /etc/default.

Run command systemctl enable docker-listen.service.

Configuration

sudo <python> docker-listen.py

Options can be loaded from a python .ini configuration file provided with -c command line option.

Example :

[docker-listen]
hosts_domain_name=docker.openwide.fr
hosts_dir=/etc/dnsmasq.d
docker_url=unix://var/run/docker.sock
sighup_enabled=yes
sighup_process_name=dnsmasq
log_level=WARN

About

Listen docker events to update dnsmasq hosts configuration

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages