Giter Club home page Giter Club logo

ouroboros's Introduction

alt text

Travis Codecov Docker Pulls

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

A python-based alternative to watchtower

Overview

Ouroboros will monitor all running docker containers or those you specify and update said containers to the latest available image in the remote registry using the latest tag with the same 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 a couple of minutes for ouroboros to find the new image and redeploy your container autonomously.
  • Limit your server ssh access
  • ssh -i key server.domainname "docker pull ... && docker run ..." is for scrubs

Usage

alt text

Ouroboros is deployed via docker image like so:

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

or via docker-compose:

version: '3'
services:
  nginx:
    image: nginx:1.14-alpine
    ports:
     - 80:80
  ouroboros:
    image: circa10a/ouroboros
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    command: --interval 60 --loglevel debug

By default, running containers will be polled every 5 min

Options

All arguments can be ran together without conflication

docker run --rm circa10a/ouroboros --help
  • --url, -u Monitor and update containers on a remote system by providing the url argument. Default is unix://var/run/docker.sock
  • --interval, -i Change how often ouroboros checks the remote docker registry for image updates (in seconds). Default is 300
  • --monitor, -m Only monitor select containers which supports an infinite amount of container names. Default is all containers.
  • --loglevel, -l The amount of logging details can be supressed or increased Default is info.
  • --runonce, -r Update all your running containers in one go and terminate ouroboros. Default is False.
  • --cleanup, -c Remove the older docker image if a new one is found and updated. Default is False.

Private Registries

If your running containers' docker images are stored in a secure registry that requires a username and password, simply run ouroboros with 2 environment variables(REPO_USER and REPO_PASS).

docker run -d --name ouroboros \
  -v REPO_USER=myUser -e REPO_PASS=myPassword \
  -v /var/run/docker.sock:/var/run/docker.sock \
  circa10a/ouroboros

You can alternatively bind mount ~/.docker/config.json which won't require the above environment variables.

docker run -d --name ouroboros \
  -v $HOME/.docker/config.json:/root/.docker/config.json \
  -v /var/run/docker.sock:/var/run/docker.sock \
  circa10a/ouroboros

Examples

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 \
  circa10a/ouroboros --url tcp://my-remote-docker-server:2375

Change update frequency

An interval argument can be supplied to change how often ouroboros checks the remote docker registry for image updates (in seconds).

Default is 300s

docker run -d --name ouroboros \
  -v /var/run/docker.sock:/var/run/docker.sock \
  circa10a/ouroboros --interval 600

Monitor select containers

By default, ouroboros will monitor all running docker containers, but can be overridden to only monitor select containers by passing a monitor argument which supports an infinite amount of container names.

Default is all

docker run -d --name ouroboros \
  -v /var/run/docker.sock:/var/run/docker.sock \
  circa10a/ouroboros --monitor containerA containerB containerC

Change loglevel

The amount of logging details can be supressed by providing a loglevel argument.

Default is info

docker run -d --name ouroboros \
  -v /var/run/docker.sock:/var/run/docker.sock \
  circa10a/ouroboros --loglevel debug

Update all containers and quit ouroboros

If you prefer ouroboros didn't run all the time and only update all of your running containers in one go, provide the runonce argument and ouroboros will terminate itself after updating all your containers one time.

Default is False

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

Remove old docker images

Ouroboros has the option to remove the older docker image if a new one is found and the container is then updated. To tidy up after updates, pass the cleanup argument.

Default is False

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

Execute Tests

Script will install dependencies from requirements-dev.txt

All tests:

./run_tests.sh

Unit tests:

./run_tests.sh unit

Integration tests:

./run_tests.sh integration

Contributing

All welcome

ouroboros's People

Contributors

circa10a avatar dannysauer avatar torpus avatar tlkamp avatar

Watchers

gavioto avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.