Skip to main content

Automatically update running docker containers

Project description

Discord BuyUsCoffee
Travis Image Version Pypi Downloads Python Version Docker Pulls Layers

Automatically update your running Docker containers to the latest available image.

A python-based alternative to watchtower

Overview

Ouroboros will monitor (all or specified) running docker containers and update them to the (latest or tagged) available image in the remote registry. The updated container uses the same tag and parameters that were used when the container was first created such as volume/bind mounts, docker network connections, environment variables, restart policies, entrypoints, commands, etc.

  • Push your image to your registry and simply wait your defined interval for ouroboros to find the new image and redeploy your container autonomously.
  • Notify you via email or platform customized webhooks. (Currently: Discord/Slack/Pushover/HealthChecks/Generic)
  • Serve metrics for trend monitoring (Currently: Prometheus/Influxdb)
  • Limit your server ssh access
  • ssh -i key server.domainname "docker pull ... && docker run ..." is for scrubs
  • docker-compose pull && docker-compose up -d is for fancier scrubs

Getting Started

More detailed usage and configuration can be found on the wiki.

Docker

Ouroboros is deployed via docker image like so:

docker run -d --name ouroboros \
  -v /var/run/docker.sock:/var/run/docker.sock \
  pyouroboros/ouroboros

This is image is compatible for amd64, arm32v7, and arm64v8 CPU architectures (regular systems and Raspberry Pi's)

or via docker-compose:

Official Example

Pip

Ouroboros can also be installed via pip:

pip install ouroboros-cli

And can then be invoked using the ouroboros command:

$ ouroboros --interval 300 --loglevel debug

This can be useful if you would like to create a systemd service or similar daemon that doesn't run in a container

Examples

Monitor for updates for latest tag

Instead of updating to your original image tag you can specify if you would like Ouroboros to update all containers to latest.
e.g. If your container was started with nginx:1.14-alpine using LATEST=true will poll the docker registry and compare digests. If there is a new image for nginx:latest, ouroboros will update your container using the newly patched version.

Default is false

docker run -d --name ouroboros \
 -v /var/run/docker.sock:/var/run/docker.sock \
 -e LATEST=true \
 pyouroboros/ouroboros

Update containers on a remote host

Ouroboros can monitor things other than just local, pass the --url argument to update a system with the Docker API exposed.

Default is unix://var/run/docker.sock

docker run -d --name ouroboros \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -e DOCKER_SOCKETS=tcp://my-remote-docker-server:2376 \
  pyouroboros/ouroboros

Many more examples are located in our wiki on the usage page

Contributing

All welcome

Project details


Download files

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

Source Distribution

ouroboros-cli-0.6.0.tar.gz (12.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page