Ouroboros is an automation engine that updates running Docker containers with the latest image from a specified contaner registry.
The updated containers will preserve all parameters and tags as the previously run container.
version: '3'
services:
ouroboros:
container_name: ouroboros
hostname: ouroboros
image: pyouroboros/ouroboros
environment:
- CLEANUP=true
- INTERVAL=300
- LOG_LEVEL=info
- SELF_UPDATE=true
- IGNORE=mongo influxdb postgres mariadb
- TZ=America/Chicago
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock
Ouroboros is no longer maintained, see more
Updating containers enables :
In this post we have built a simple site visit counter , that saves unique page visits in Redis under the key visits
.
The visits
key contains the browser user agent and the ip .
The visits
counter can be reset by going to the /reset
route of the application.
The application architecure is as shown below.
We’ll be using Slack to manage notifications. Anytime a container is updated we’ll receive a notification in a specified channel.
In this case we’ll configure an incoming webhook
. To do so create a free workspace, or use an existing workspace.
Use this link to create a webhook.
Next assign a workspace channel that will be receiving the messages.
You’ll get a webhook channel in the format https://hooks.slack.com/service/<TOKENA>/<TOKENB>/<TOKENC>
.
That’s it.
You can add an icon if you need to.
As we’ll be running Ourboros as a Docker container we’ll pass all the environment variables in an ouroboros.env
file.
Possible Env variables can be found here
In this sample we’ll be using docker-compose
to deploy our service therefore we wrote a docker-compose.yml
to deploy our application, and bring up Ouroboros with our desired configurations.
For multiple sockets/hosts set a space separated list of DOCKER_SOCKETS
in your environment file. Learn More
Learn how to push your images to Docker registry {% post_link devops-with-bitbucket-pipelines ‘using Bitbucket pipelines’ %}.
Every update will push a notification to Slack, you can disable startup notifcations by setting SKIP_STARTUP_NOTIFICATIONS
in the environment file to True
.
Here’s an interactive tutorial to get you up and running with Ouroboros :
Use this example application hosted on github
Refer to Ouroboros wiki