Skip to content

Latest commit

 

History

History
96 lines (69 loc) · 3.78 KB

MANUALLY_BUILDING_IMAGES.md

File metadata and controls

96 lines (69 loc) · 3.78 KB

Table of Contents generated with DocToc

Building docker images

In order to build images on local hardware, you need to have the buildx plugin installed to run the build. Also, you need to have regctl installed from https://github.com/regclient/regclient in order to tag the multi-platform images in DockerHub. The script to build images will refuse to work if you do not have those two installed.

You also need to have the right permissions to push the images, so you should run docker login before and authenticate with your DockerHub token.

Setting environment with emulation

According to the official installation instructions this can be achieved via:

docker run --privileged --rm tonistiigi/binfmt --install all

More information can be found here.

However, emulation is very slow - more than 10x slower than hardware-backed builds.

Setting up cache refreshing with hardware ARM/AMD support

If you plan to build a number of images, it's probably better to set up a hardware remote builder for your ARM or AMD builds (depending which platform you build images on - the "other" platform should be remote).

This can be achieved by settings build as described in this blog post and adding it to docker buildx airflow_cache builder.

This usually can be done with those two commands:

docker buildx create --name airflow_cache   # your local builder
docker buildx create --name airflow_cache --append HOST:PORT  # your remote builder

One of the ways to have HOST:PORT is to login to the remote machine via SSH and forward the port to the docker engine running on the remote machine.

When everything is fine you should see both local and remote builder configured and reporting status:

docker buildx ls

  airflow_cache          docker-container
       airflow_cache0    unix:///var/run/docker.sock
       airflow_cache1    tcp://127.0.0.1:2375

Preparing regular images:

breeze release-management release-prod-images --airflow-version "${VERSION}"

Preparing slim images:

breeze release-management release-prod-images --airflow-version "${VERSION}" --slim-images

This will wipe Breeze cache and docker-context-files in order to make sure the build is "clean". It also performs image verification after pushing the images.