docker-printer
is a CLI for easily managing multistep and branching dockerfiles.
Regular multi-stage dockerfiles and docker build
commands are incredibly powerful and useful; however, they are designed for building a single image. Multistage builds can be used to define multiple related images, but this quickly results in complicated dockerfiles, possibly duplicated instructions, and complicated collections of build commands.
docker-printer
addresses this in two main ways:
- By allowing dockerfiles to be composed from re-usable modules.
- By building bake files for use by
docker buildx bake
that consolidate the build processes of multiple images in multiple environments into a single configuration file.
pip install docker-printer
docker-printer init
See the documentation for how to get started.
There are also example docker constructs provided in the /examples
folder.
With the release of docker-printer
1.x, the tool now uses pydantic==2.*
. If you require pydantic==1.*
, please use docker-printer==0.*
. New features will continue to be added to both version 0 and version 1 for the time being.