Last built 4 months ago using go version go1.7.4 linux/amd64 and 130 seconds of time

File Size
Project-Readme for this version

Go Report Card License: Apache v2.0 GoDoc reference

luzifer / dockermanager

The intention of this project is to have a running daemon on a docker host server which is able to realize a configuration of docker containers. For this it manages all containers and images on the docker host. This includes starting and stopping containers which are or are not defined by the configuration file.

Missing / Planned Features

  • Support load balancing / distribution of containers to create spread load on all servers
    • For this feature the serf master-election was built in. Currently it is not used.


  • One or more host servers with latest lxc-docker
  • A serf-agent running on each host and connected to one gossip-network
  • A config file or config URL to serve the configuration from
  • Docker daemon listening on tcp port
  • The dockermanager set up
  • If you want to use images from a private registry put a .dockercfg file (docker login) to the homedir of the user running dockermanager


CLI parameters

# ./dockermanager --help
Usage of ./dockermanager:
  -c, --config="config.yaml": Config file or URL to read the config from
      --configInterval=10: Sleep time in minutes to wait between config reloads
      --docker-certs="": Directory containing cert.pem, key.pem, ca.pem for the registry
      --docker-host="tcp://": Connection method to the docker server
      --fullHost[=true]: Manage all containers on host
      --refreshInterval=30: fetch new images every <N> minutes
      --serfAddress="": Address of the serf agent to connect to
      --standalone[=false]: Do not use Serf to talk to other hosts

Configuration file

The configuration is written in YAML format and reloaded regulary by the daemon:

  • container-name: Name of the container on the host. Needs to be unique
    • command: Override CMD value set by Dockerfile
    • hosts: Array of hostnames (serf node names) to deploy the container to or ALL
    • image: Name of the image registry or luzifer/jenkins or
    • tag: Tag for the image, probably latest
    • links: Links to other containers in format othercontainername:alias
    • volumes: Volume mapping in form <localdir>:<containerdir>
    • ports: Array of port configurations
    • container: Exported port in the container e.g. 80/tcp or 12201/udp
    • local: IP/port combination in the form <ip>:<port>
    • environment: Array of enviroment variables in form <key>=<value>
    • update_times: Array of allowed time frames for updates of this container in format HH:MM-HH:MM (Optional, if not specified container is allowed to get updated all the time.)
    • start_times: Cron-style time specification when to start this container. Pay attention to choose a container quitting before your specified interval for this. Containers having this specification will not get started by default and are not restarted after they quit. Use this for starting cron-like tasks.
    • stop_timeout: Time in seconds to wait when stopping a deprecated container to be exchanged. (default: 5s)
    • labels: Labels to attach to the container (for example the config for the DockerProxy)
    • dockerproxy: Configuration for the dockerproxy
    • slug: Name part of the URL to map to this container
    • port: Published port (see ports above)
    • add_cap: Array of capabilities to add to this container

Example configuration for a jenkins container:

    - docker01
  image: luzifer/jenkins
  tag: latest
    - "othercontainername:alias"
    - "/home/ubuntu/data/jenkins_home:/var/jenkins_home"
    - container: 8080/tcp
    - MYVAR=value
    slug: jenkins
    port: 1000
    - 04:00-06:00
  stop_timeout: 20

    - docker01
  image: jlekie/curl
  tag: latest
    - ""
  start_times: "*/2 * * * *"

Development Status

Current version is marked as 0.x.x and for this it is to be considered unstable. As soon as the load balancing is implemented I will move to the 1.x.x version and the app will be stable within the major version.