Skip to content

Build multi arch build-x #10854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,49 @@ description: You can build multi-architecture images in a CI pipeline.
sidebar_position: 21
---

This document covers methods for building multi architecture images in Harness with or without [Docker layer caching (DLC)](/docs/continuous-integration/use-ci/caching-ci-data/docker-layer-caching).

## With DLC

:::info Self-Hosted Infrastructure

If you're using self-hosted infrastructure, turn on the feature flag `CI_ENABLE_DLC_SELF_HOSTED`. To enable this flag, contact [Harness Support](mailto:[email protected]).

:::

1. Open your [Build and Push an image to Docker Registry](/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-and-push/build-and-push-to-docker-registry/) step.
2. Select `Enable Docker Layer caching`. To learn more, go to [Docker layer caching](/docs/continuous-integration/use-ci/caching-ci-data/docker-layer-caching).
2. Open the **Optional Configuration** dropdown at the bottom of the step.
3. Add a variable under **Environment Variables**.
4. Enter `PLUGIN_PLATFORM` for your **Key**.
5. Enter your architectures as a comma separated list as your **Value**. For example, `linux/amd64,linux/arm64`.

## Without DLC

:::info Kubernetes Infrastructure

If you're using Kubernetes infrastructure, turn on the feature flag `CI_USE_BUILDX_ON_K8`. To enable this flag, contact [Harness Support](mailto:[email protected]).

:::

1. Open your [Build and Push an image to Docker Registry](/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-and-push/build-and-push-to-docker-registry/) step.
2. Open the **Optional Configuration** dropdown at the bottom of the step.
3. Add two variables under **Environment Variables**.
4. Enter `PLUGIN_PLATFORM` for your first **Key**.
5. Then, enter your architectures as a comma separated list as your **Value**. For example, `linux/amd64,linux/arm64`.
6. Enter `PLUGIN_BUILDER_DRIVER` for your second variable's **Key**.
7. Then, enter `docker-container` for your second variable's **Value**.

## Deprecated Methods
<details>
<summary>Deprecated method of building multi-arch images on Kubernetes infrastructure</summary>

:::info

The following method for building multi-arch images is not recommended.

:::

To build multi-architecture images in a CI pipeline, use a separate stage to build and push each architecture.

For example, the following pipeline has two stages. The two stages have similar components, but they differ according to the architecture of the image that the stage builds. Each stage has:
Expand Down Expand Up @@ -146,3 +189,5 @@ pipeline:
limits:
memory: 100M
```

</details>