Supported builder engines

CEKit supports following builder engines:

Docker builder

This builder uses Docker daemon as the build engine. Interaction with Docker daemon is done via Python binding.

Input format
Dockerfile
Parameters
  • --pull – ask a builder engine to check and fetch latest base image
  • --tag – an image tag used to build image (can be specified multiple times)
  • --no-squash – do not squash the image after build is done.
Example

Building Docker image

$ cekit build docker

Remote Docker daemon

It is possible to use environment variables to let CEKit know where is the Docker daemon located it should connect to.

By default, if you do not specify anything, CEKit will try to use a locally running Docker daemon.

If you need to customize this behavior (for example when you want to use Docker daemon running in a VM) you can set following environment variables: DOCKER_HOST, DOCKER_TLS_VERIFY and DOCKER_CERT_PATH. See section about Docker environment variables below for more information.

Docker environment variables

DOCKER_HOST

The DOCKER_HOST environment variable is where you specify where the Daemon is running. It supports multiple protocols, but the most widely used ones are: unix:// (where you specify path to a local socket) and tcp:// (where you can define host location and port).

Examples of DOCKER_HOST: unix:///var/run/docker.sock, tcp://192.168.22.33:1234.

Depending how your daemon is configured you may need to configure settings related to encryption.

# Connect to a remote Docker daemon
$ DOCKER_HOST="tcp://192.168.22.33:1234" cekit build docker
DOCKER_TLS_VERIFY
You can set DOCKER_TLS_VERIFY to a non-empty value to indicate that the TLS verification should take place. By default certificate verification is disabled.
DOCKER_CERT_PATH
You can point DOCKER_CERT_PATH environment variable to a directory containing certificates to use when connecting to the Docker daemon.
DOCKER_TMPDIR

You can change the temporary directory used by Docker daemon by specifying the DOCKER_TMPDIR environment variable.

Note

Please note that this is environment variable should be set on the daemon and not on the client (CEKit command you execute). You need to modify your Docker daemon configuration and restart Docker to apply new value.

By default it points to /var/lib/docker/tmp. If you are short on space there, you may want to use a different directory. This temporary directory is used to generate the TAR file with the image that is later processed by the squash tool. If you have large images, make sure you have sufficient free space there.

TMPDIR

This environment variable controls which directory should be used when a temporary directory is created by the CEKit tool. In case the default temporary directory location is low on space it may be required to point to a different location.

One example when such change could be required is when the squash post-processing of the image is taking place and the default temporary directory location is low on space. Squashing requires to unpack the original image TAR file and apply transformation on it. This can be very storage-consuming process.

You can read more on how this variable is used in the Python docs.

$ TMPDIR="/mnt/external/tmp" cekit build docker
DOCKER_TIMEOUT

By default it is set to 600 seconds.

This environment variable is responsible for setting how long we will wait for the Docker daemon to return data. Sometimes, when the Docker daemon is busy and you have large images, it may be required to set this variable to some even higher number. Setting proper value is especially important when the squashing post-processing takes place because this is a very resource-consuming task and can take several minutes.

$ DOCKER_TIMEOUT="1000" cekit build docker

OSBS builder

This build engine is using rhpkg or fedpkg tool to build the image using OSBS service. By default it performs scratch build. If you need a proper build you need to specify --release parameter.

Input format
Dockerfile
Parameters
  • --release – perform an OSBS release build
  • --tech-preview – build tech preview image, see below for more information
  • --user – alternative user passed to build task
  • --nowait – do not wait for the task to finish
  • --stage – use stage environment
  • --koji-target – overrides the default koji target
  • --commit-message – custom commit message for dist-git
Example

Performing scratch build

$ cekit build osbs

Performing release build

$ cekit build osbs --release

Tech preview images

Deprecated since version 3.3: Use the overrides feature instead:

$ cekit build --overrides '{"name": "custom-family-tech-preview/project-8-centos7"}' osbs

The OSBS builder has support for building a tech preview image without modifying the image source. The only difference between a regular image and the tech preview image is the resulting name of the image. Tech preview images contain the -tech-preview suffix in the image family of the name.

$ cekit build osbs --tech-preview

Note

You can combine the --tech-preview preview switch with --release switch.

Example
The custom-family/project-8-centos7 image built with the --tech-preview switch will become custom-family-tech-preview/project-8-centos7.

Buildah builder

This build engine is using Buildah.

Note

If you need to use any non default registry, please update /etc/containers/registry.conf file.

Input format
Dockerfile
Parameters
  • --pull – ask a builder engine to check and fetch latest base image
  • --tag – an image tag used to build image (can be specified multiple times)
Example

Build image using Buildah

$ cekit build buildah

Build image using Buildah and tag it as example/image:1.0

$ cekit build buildah --tag example/image:1.0

Podman builder

This build engine is using Podman. Podman will perform non-privileged builds so no special configuration is required.

Input format
Dockerfile
Parameters
  • --pull – ask a builder engine to check and fetch latest base image
  • --tag – an image tag used to build image (can be specified multiple times)
Example

Build image using Podman

$ cekit build podman

Build image using Podman

$ cekit build podman --pull