Skip to main content

Lightweight tool for docker image creation with multiple variants.

Project description

doimbu | doimbu - Docker Image Builder

Lightweight tool for docker image creation with multiple variants.

doimbu

Quick summary

Docker image creation with multiple variants with a single small command.

Scenario

Some docker images need to be delivered in multiple variants.
For example, every mongodb image version have multiple suffixes:

  • 7.0.14-ubi8
  • 7.0.14-ubi9
  • 7.0.14-ubuntu2204

When you change the version of these images, you'll need to tediously issue slightly changed long docker build commands for every variant.

Doimbu streamlines this task, with a config file you'll store all your docker configuration that you need for your docker build commands, and with a single command you'll create the docker build commands to all docker image variants that you need.

Table of contents

Dependencies

Required installed software:
(not covered in these instructions)

  • docker 27.3.1+
  • python 3.12.3+
  • poetry 1.8.4+ (optional)

(development and testing versions, it may be compatible with previous versions)

Installation

Global installation

pip install doimbu

(it's recommended to use a virtual environment instead of installing it globally)

Virtualenv installation

python -m venv venv
source venv/bin/activate
pip install doimbu
deactivate

Image Tag Pattern

[tag_namespace/][tag_repository]:[version]-[variant]

Tab pattern example

  • mongodb/mongodb-community-server:7.0.14-ubi8
  • mongodb/mongodb-community-server:7.0.14-ubi9
  • mongodb/mongodb-community-server:7.0.14-ubuntu2204

Configuration

Doimbu retrieves its configuration from 4 sources:

  • project root path
  • project directory structure
  • doimbu.ini configuration file
  • command line parameters

project path

tag_repository
The tag repository is retrieved from the project root path leaf.

project directory structure

variant
A directory called variants should be created at your project root path.
Inside this directory, subdirectories containing Dockerfiles should be created for each image variant.

doimbu.ini

All build configurations are placed at this file, including overrides for the tag_repository and variant.

Samples

  • Only mandatory configuration doimbu.ini (default_variant and vesion).
  • Full sample doimbu.ini (with all available parameters).

command line parameters

All configuration that can be placed in doimbu.ini can also be overridden by command line parameters.

A simple way to check all command line options is:

python -m doimbu --help

Usage

Minimal usage form

(all config from file system and doimbu.ini)

python -m doimbu

Usage with parameters

python -m doimbu --default-variant nobel --tag-namespace mongodb --tag-repository mongodb-community-server --build-arg 'git_username="jhonny joe"' --build-arg 'git_user_email="jhonny@joe.com"' --dry-run

How to run tests

To execute the tests, execute the following command:

poetry run pytest

Contributing

Contributing instructions can be found here.

Contact

alex carvalho - linkedin.com/in/alex-carvalho-big-data

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

doimbu-0.6.0.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

doimbu-0.6.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file doimbu-0.6.0.tar.gz.

File metadata

  • Download URL: doimbu-0.6.0.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.3 Linux/6.8.0-51-generic

File hashes

Hashes for doimbu-0.6.0.tar.gz
Algorithm Hash digest
SHA256 c7e90fd9c620a0ad3d43975c9da5cbf61fd803c7a04a59300a33d2b3d8853329
MD5 654a7abb27b05b8c54dd29ce455e123e
BLAKE2b-256 fb674ae1b1c7a0669243638bee90426f4046fbefcfae7914d984d5908780a63d

See more details on using hashes here.

File details

Details for the file doimbu-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: doimbu-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.3 Linux/6.8.0-51-generic

File hashes

Hashes for doimbu-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b264c58f9eab100b69912f7f9fa267616ca71a414b0ed7498bf42cd9b91e53f2
MD5 fed03c12b5b51bbe2a277a013c0b3e9b
BLAKE2b-256 2ba3baa8cf71906874a905c07bac93ee1ca1a8e20f4ab259dfbdd392c829b0e1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page