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.
Updating containers enables :
- quick and easy patching of security vulnerabilities
- quick update running applications
- customization of images to suit business needs
In this post we have built a simple site visits counter , that saves unique page visits in Redis under the key
visits key contains the browser user agent and the _ip_ .
visits counter can be reset by going to the
/reset route of the application.
The application architecure is as shown below.
graph LR subgraph docker subgraph app logic-->keys end subgraph redis keys-.->db end subgraph ouroboros update-->notify update-.->logic end end subgraph webhook notify-.->message message end
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
You can add an icon if you need to
As we’ll be running Ourboros as a Docker container we’ll pass all the environement variables in an
Possible Env variables can be found here
# Auto Update Ourbororos see -> https://github.com/pyouroboros/ouroboros/wiki/Usage#self-update
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 do Docker registry 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
Here’s an interactive tutorial to get you up and running with Ouroboros :