This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Daemon for Docker Automation

Project Description

autodock is a Daemon for Docker Automation.

autodock is MIT licensed.

Installation

Either pull the automatically updated Docker image:

$ docker pull prologic/autodock

Or install from the development repository:

$ git clone https://github.com/prologic/autodock.git
$ cd autodock
$ pip install -r requirements.txt

Plugins

autodock comes with a number of plugins where each piece of functionality is provided by a separate plugin. Each plugin is “linked” to autodock to receive Docker events and issue new Docker API commands. The following list is a list of the currently available plugins for production use:

Example #1 – Logging Docker Events

Start the daemon:

$ docker run -d -v /var/run/docker.sock:/var/run/docker.sock --name autodock:autodock prologic/autodock

Link and start an autodock plugin:

$ docker run -i -t --link autodock prologic/autodock-logger

Now whenever you start a new container autodock will listen for Docker events. The autodock-logger plugin will log all Docker Events received by autodock.

Example #2 – Automatic Virtual Hosting with hipache

Start the daemon:

$ docker run -d --name autodock prologic/autodock

Link and start an autodock plugin:

$ docker run -d --link autodock prologic/autodock-hipache

Now whenever you start a new container autodock will listen for Docker events and discover containers that have been started. The autodock-hipache plugin will specifically listen for starting containers that have a VIRTUALHOST environment variable and reconfigure the running hipache container.

Start a “Hello World” Web Application:

$ docker run -d -e VIRTUALHOST=hello.local prologic/hello

Now assuming you had hello.local configured in your /etc/hosts pointing to your hipache container you can now visit http://hello.local/

echo "127.0.0.1 hello.local" >> /etc/hosts
curl -q -o - http://hello.local/
Hello World!

Note

This method of hosting and managing webapps and websites is in production deployments and talked about in more detail in the post A Docker-based mini-PaaS.

Example #3 – Cron-like Scheduling of Containers

Start the daemon:

$ docker run -d --name autodock prologic/autodock

Link and start an autodock plugin:

$ docker run -d --link autodock prologic/autodock-cron

Now whenever you create a new container autodock will listen for Docker events and discover containers that have been created. The autodock-cron plugin will specifically listen for created containers that have a CRON environment variable and schedule a job based on the cron expression supplied and re-run that container when its scheduled has triggered.

Start a “Hello” Busybox Container:

$ docker run -i -t --name hello busybox sh -c "echo Hello"

After about three minutes or so you should see the following in the logs:

$ docker logs hello
Hello
Hello
Hello
Release History

Release History

This version
History Node

0.0.2

History Node

0.0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
autodock-0.0.2-py2-none-any.whl (12.0 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Dec 26, 2015
autodock-0.0.2.tar.gz (8.4 kB) Copy SHA256 Checksum SHA256 Source Dec 26, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting