Building Container Images

Two make targets exists to build container images automatically based on the locally checked out branch:

Developer images

Run make dev-docker-image to build a cilium-agent Docker image that contains your local changes.

  1. DOCKER_DEV_ACCOUNT=quay.io/myaccount DOCKER_IMAGE_TAG=jane-developer-my-fix make dev-docker-image

Run make docker-operator-generic-image (respectively, docker-operator-aws-image or docker-operator-azure-image) to build the cilium-operator Docker image:

  1. DOCKER_DEV_ACCOUNT=quay.io/myaccount DOCKER_IMAGE_TAG=jane-developer-my-fix make docker-operator-generic-image

The commands above assumes that your username for quay.io is myaccount. You can then push the image tag to your own registry for development builds:

  1. docker push quay.io/myaccount/cilium-dev:jane-developer-my-fix-amd64

Official release images

Anyone can build official release images using the make target below.

  1. DOCKER_IMAGE_TAG=v1.4.0 make docker-images-all

Official Cilium repositories

The following table contains the main container image repositories managed by Cilium team. It is planned to convert the build process for all images based on GH actions.

Github RepositoryDockerfilecontainer image repositoryArchitecturesBuild process
amd64aarch64
github.com/cilium/ciliumcontrib/packaging/docker/Dockerfile.runtimequay.io/cilium/cilium-runtimeYNQuay auto
Dockerfile.builderquay.io/cilium/cilium-builderYNQuay auto
Dockerfile[docker|quay].io/cilium/ciliumYNQuay/Docker auto
cilium-docker-plugin.Dockerfile[docker|quay].io/cilium/docker-pluginYNQuay/Docker auto
hubble-relay.Dockerfile[docker|quay].io/cilium/hubble-relayYNQuay/Docker auto
cilium-operator.Dockerfile[docker|quay].io/cilium/operatorYNQuay/Docker auto
cilium-operator-aws.Dockerfile[docker|quay].io/cilium/operator-awsYNQuay/Docker auto
cilium-operator-azure.Dockerfile[docker|quay].io/cilium/operator-azureYNQuay/Docker auto
cilium-operator-generic.Dockerfile[docker|quay].io/cilium/operator-genericYNQuay/Docker auto
clustermesh-apiserver.Dockerfile[docker|quay].io/cilium/clustermesh-apiserverYNQuay/Docker auto
github.com/cilium/proxyDockerfile.builderquay.io/cilium/cilium-envoy-builderYNQuay auto
Dockerfilequay.io/cilium/cilium-envoyYNQuay auto
github.com/cilium/image-toolsimages/bpftool/Dockerfiledocker.io/cilium/cilium-bpftoolYYGH Action
images/iproute2/Dockerfiledocker.io/cilium/cilium-iproute2YYGH Action
images/llvm/Dockerfiledocker.io/cilium/cilium-llvmYYGH Action
images/compilers/Dockerfiledocker.io/cilium/image-compilersYYGH Action
images/maker/Dockerfiledocker.io/cilium/image-makerYYGH Action
images/startup-script/Dockerfiledocker.io/cilium/startup-scriptYYGH Action

Image dependency:

  1. [docker|quay].io/cilium/cilium
  2. depends on:
  3. quay.io/cilium/cilium-builder
  4. depends on:
  5. quay.io/cilium/cilium-runtime
  6. depends on:
  7. docker.io/cilium/cilium-iproute2
  8. docker.io/cilium/cilium-bpftool
  9. docker.io/cilium/cilium-llvm
  10. quay.io/cilium/cilium-envoy
  11. depends on:
  12. quay.io/cilium/cilium-envoy-builder
  13. depends on:
  14. quay.io/cilium/cilium-builder
  15. depends on:
  16. quay.io/cilium/cilium-runtime
  17. depends on:
  18. docker.io/cilium/cilium-iproute2
  19. docker.io/cilium/cilium-bpftool
  20. docker.io/cilium/cilium-llvm

Update cilium-builder and cilium-runtime images

Login to quay.io with your credentials to the repository that you want to update:

cilium-builder - contains Cilium build-time dependencies cilium-runtime - contains Cilium run-time dependencies

  1. After login, select the tab “builds” on the left menu.

../../../_images/cilium-quayio-tag-0.png

  1. Click on the wheel.
  2. Enable the trigger for that build trigger.

../../../_images/cilium-quayio-tag-1.png

  1. Confirm that you want to enable the trigger.

../../../_images/cilium-quayio-tag-2.png

  1. After enabling the trigger, click again on the wheel.
  2. And click on “Run Trigger Now”.

../../../_images/cilium-quayio-tag-3.png

  1. A new pop-up will appear to select your desired branch.
  2. If you’re interested in simply bumping the image to have the latest packages, then select the release branch (i.e. v1.7, v1.8). If you already have a branch that contains changes, select the branch that contains the new changes.

../../../_images/cilium-quayio-tag-4.png

  1. After selecting your branch click on “Start Build”.

../../../_images/cilium-quayio-tag-5.png

  1. Once the build has started you can disable the Build trigger by clicking on the wheel.
  2. And click on “Disable Trigger”.

../../../_images/cilium-quayio-tag-6.png

  1. Confirm that you want to disable the build trigger.

../../../_images/cilium-quayio-tag-7.png

  1. Once the build is finished click under Tags (on the left menu).
  2. Click on the wheel and;
  3. Add a new tag to the image that was built.

../../../_images/cilium-quayio-tag-8.png

  1. Write the name of the tag that you want to give for the newly built image.
  2. Confirm the name is correct and click on “Create Tag”.

../../../_images/cilium-quayio-tag-9.png

  1. After the new tag was created you can delete the other tag, which is the name of your branch. Select the tag name.
  2. Click in Actions.
  3. Click in “Delete Tags”.

../../../_images/cilium-quayio-tag-10.png

  1. Confirm that you want to delete tag with your branch name.

../../../_images/cilium-quayio-tag-11.png

You have created a new image build with a new tag. The next steps should be to update the repository root’s Dockerfile so that it points to the new cilium-builder or cilium-runtime image recently created.

  1. Update the versions of the images that are pulled into the CI VMs.
  • Open a PR against the Packer-CI-Build with an update to said image versions. Once your PR is merged, a new version of the VM will be ready for consumption in the CI.
  • Update the SERVER_VERSION field in test/Vagrantfile to contain the new version, which is the build number from the Jenkins Job for the VMs. For example, build 119 from the pipeline would be the value to set for SERVER_VERSION.
  • Open a pull request with this version change in the cilium repository.

Nightly Docker image

After each successful Nightly build, a cilium/nightly image is pushed to dockerhub.

To use latest nightly build, please use cilium/nightly:latest tag. Nightly images are stored on dockerhub tagged with following format: YYYYMMDD-<job number>. Job number is added to tag for the unlikely event of two consecutive nightly builds being built on the same date.