🐳 Generi

Generi lets you create huge set of dockerfiles from a template, build and tag all of them and optionally push them to a repository of your choice. By using matrix builds, it’s a breeze to build a huge variety of images for your application.

🐍 Installation

$ pip install generi

Or if you prefer an alternative package manager.

$ poetry add generi
$ pipenv install generi

✈️ Quickstart

Generi can be configured using a simple yaml file that defines your matrix build.

schema.yaml

parameters:
  python_version:
    - 2.7
    - 3.5
    - 3.6
    - 3.7
  operating_system:
    - buster
    - alpine

template: templates
output: "output/{{ python_version }}/{{ operating_system }}"
image: "nicklehmann/myapplication:py{{ python_version }}-{{ operating_system }}"

registry:
  username: nicklehmann

templates/Dockerfile

FROM python:{{ python_version }}-{{ operating_system }}

COPY main.py main.py

CMD ["python", "main.py"]

First, render your dockerfiles by running

$ generi write schema.yaml

After that, build and optionally push your image.

$ generi build schema.yaml
$ generi push schema.yaml