DEV Community

Clemens Kaserer
Clemens Kaserer

Posted on

cookiecutter for container images

What is cookiecutter?!

Cookiecutter is a command-line utility that creates projects from cookiecutters (project templates), e.g. creating a Python package project from a Python package project template.


I maintain a containerized version of all cookiecutter releases starting with 1.7.0 at dockerhub.
If you want to know more check out the associated repository at or my blog post containerized cookiecutter.

Cookiecutter for container images

The goal of today is to standardize and automate your container image build process. From folder structure, to CICD, to publishing to a container registry, to build notifications via slack with cookiecutter templates.


Getting stared

To process the docker-cookiecutter template execute


Here a quick look at the resulting target folder structure

├── .ci
│   └──                     <- put your tests here
├── .dockerignore                   <- ignore files when building
├── .github                         <- github issue templates
│       ├──
│       └──
├── .gitignore
├── .travis.yml                     <- slack notifications for our tests
├── Dockerfile                      <- what we actually want
├──                       <- badges and quickstart info
└── bashrc                          <- bash functions for easy of use

Next, we need to add our registry credentials to be able to push our images to a container registry and our slack integration for build notifications.
You can find a how-to for those steps in the of your processed docker-cookiecutter template or directly via this link.


Top comments (0)