This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

A utility to update docker images automatically. Supports execution of arbitrary commands when an image is updated, in order to restart running containers or trigger other custom behaviour.

Installation

Docker image updater can be installed from the Python Package Index using:

pip install docker-image-updater

Installation into a virtualenv is highly recommended!

Usage

usage: docker-image-updater [-h] [-f FILE] [--debug] [file [file ...]]

positional arguments:
  file                  configuration file(s) to use

optional arguments:
  -h, --help            show this help message and exit
  -f FILE, --file FILE  deprecated - this flag will be removed in the future
  --debug               show debug messages

Docker image updater requires one or more configuration files which specify sets of images to watch and commands to execute. By default it will look for /etc/docker-image-updater.yml but you may give one or more alternate files on the command-line.

When specifying more than one configuration file, the settings will be merged together with items from the latter configuration file(s) overwriting items from earlier files.

Recommended usage is to run docker image updater from cron, using something like cronic to receive mail only in case of errors.

Example output

# docker-image-updater
22:13:04 INFO     Updater    Checking images in set jenkins
22:13:04 INFO     Updater    Updating image zoni/jenkins
22:13:04 INFO     Updater    Pulling image zoni/jenkins
...........................................................................................................................................................................................................................................................................................................................
22:14:50 INFO     Updater    Image zoni/jenkins updated to latest version
22:14:50 INFO     Updater    Running command: supervisorctl restart jenkins
jenkins: stopped
jenkins: started
22:14:54 INFO     Updater    Command exited successfully

Configuration format

Configuration is expressed through a YAML file such as the following:

config:
  docker:
    base_url: "unix://var/run/docker.sock"
    version: "1.16"
watch:
  my-app:
    images:
     - my-app
     - redis
    commands:
     - restart my-app

The item watch defines sets of images to watch. This is a dictionary where the keys (my-app in the example above) are arbitrary values for human reference. Under each of these keys a dictonary with the items images and commands is expected.

images defines a list of docker images to check for updates. You can specify these as image:tag or simply as image, in which case Docker will use the latest tag automatically.

commands defines a list of shell commands to execute whenever one of the listed images was updated. These will be run sequentially, in order.

All items under config.docker are passed to the Docker client. For supported options, refer to the docker-py documentation.

Exit codes

Docker image updater will exit with status 0 when everything went well, and there were either no updates or images were updated and all defined commands returned status code 0.

If an image fails to update or one or more defined commands exits with a non-zero exit status then docker image updater will itself exit with status 1.

Star me

If you use this software, please consider starring it on GitHub. This will give me some idea of how much it is used by other people.

Changes

1.0.0 (2015-11-10)

  • Allow multiple configuration files to be specified (settings will be merged in order)
  • Deprecated the –file argument
  • Print friendlier error messages in many cases of incorrect configurations

0.0.2 (2015-03-02)

  • Friendlier config file load error message
  • Change default config to /etc/docker-image-updater.yml

0.0.1 (2015-03-01)

  • Initial public release.

License

The MIT License (MIT)

Copyright (c) 2015 Nick Groenen <nick@groenen.me>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Release History

Release History

1.0.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
docker_image_updater-1.0.0-py2.py3-none-any.whl (11.8 kB) Copy SHA256 Checksum SHA256 3.4 Wheel Nov 10, 2015
docker-image-updater-1.0.0.tar.gz (29.6 kB) Copy SHA256 Checksum SHA256 Source Nov 10, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development 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