This repository has been archived on 2020-03-09. You can view files and clone it, but cannot push or open issues or pull requests.

Docker image upgrade tool

The goal of this script is to make sure we use the latest available docker image for all containers.

It works as follows:

  1. Loop through git repositories where Drone CI is enabled
  2. Get the Dockerfile of each git repository and get the docker base image (this is specified in the FROM LINE in the Dockerfiles)
  3. Try to find the docker-compose.yml file and get images pulled from remote registries
  4. Connect to the local docker daemon, pull the images and see if a newer version of them exist
  5. If it does, trigger a CI (Continuous integration) job to start a new container on top of the new image

How to use this?

Get the latest version (or clone the repository if you feel adventurous), rename config.cfg.dist to config.cfg and fill in the right parameters. Then install the required Python packages found in requirements.txt using pyenv:

python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt

Then you can run the script with python upgrade-drone.py to upgrade images for all projects, or use the --repo command line flag to specify a git repository.

Description
Tool to upgrade docker images
Readme 55 KiB
Languages
Python 100%