From 1e373689ef69574d35f075a58b06893dc18da59a Mon Sep 17 00:00:00 2001 From: Sushrut Athavale Date: Tue, 8 Jul 2025 17:31:20 -0700 Subject: [PATCH 1/5] Build multi arch build-x --- .../build-multi-arch.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md b/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md index 606cbce6b78..741fec4cd87 100644 --- a/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md +++ b/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md @@ -4,6 +4,22 @@ description: You can build multi-architecture images in a CI pipeline. sidebar_position: 21 --- +Building multi-architecture images is possible with Harness but differs based on your infrastructure type. Please choose the infrastructure that is right for you. + +## Cloud, Local, VMs Infrastructure + +Building multi-architecture images is simple for cloud, local, and VM infrastructures. You will need to enable an environment variable in your `Build and Push an image to Docker` step. To do so: + +1. Open your `Build and Push an image to Docker Registry` step. +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`. + +That's it! + +## Kubernetes Infrastructure + 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: From 7a811f7113ff443d95d59ab7dd7f1b7871d1f467 Mon Sep 17 00:00:00 2001 From: Sushrut Athavale Date: Mon, 14 Jul 2025 15:34:21 -0700 Subject: [PATCH 2/5] Simplest instructions, chose to obfuscate `CI_USE_BUILDX_ON_K8` --- .../build-multi-arch.md | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md b/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md index 741fec4cd87..1f98cfd3fd2 100644 --- a/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md +++ b/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md @@ -6,11 +6,12 @@ sidebar_position: 21 Building multi-architecture images is possible with Harness but differs based on your infrastructure type. Please choose the infrastructure that is right for you. -## Cloud, Local, VMs Infrastructure +## Cloud Infrastructure -Building multi-architecture images is simple for cloud, local, and VM infrastructures. You will need to enable an environment variable in your `Build and Push an image to Docker` step. To do so: +Building multi-architecture images is simple for cloud infrastructures. You will need to enable an environment variable in your `Build and Push an image to Docker` step. To do so: 1. Open your `Build and Push an image 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**. @@ -18,7 +19,20 @@ Building multi-architecture images is simple for cloud, local, and VM infrastruc That's it! -## Kubernetes Infrastructure +## Self-Managed Infrastructure + +In order to build multi-architecture images with Kubernetes infrastructure, you will need to use BuildX and DLC. To do so you will require the feature flag `CI_ENABLE_DLC_SELF_HOSTED`. To enable this flag, contact [Harness Support](mailto:support@harness.io) + +Once this flag is enabled, simply complete the [cloud infrastructure steps above](#cloud-infrastructure) to build multi-architecture images. + +
+Deprecated method of building multi-arch images on Kubernetes infrastructure + +:::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. @@ -162,3 +176,5 @@ pipeline: limits: memory: 100M ``` + +
\ No newline at end of file From 086b0c9f5e8a7f1909068edbf5b8aaaa65955c6c Mon Sep 17 00:00:00 2001 From: Sushrut Athavale Date: Mon, 14 Jul 2025 15:51:57 -0700 Subject: [PATCH 3/5] DLC seems to be the prime differentiator in method not infra --- .../build-multi-arch.md | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md b/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md index 1f98cfd3fd2..13b7a49ff0f 100644 --- a/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md +++ b/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md @@ -4,11 +4,15 @@ description: You can build multi-architecture images in a CI pipeline. sidebar_position: 21 --- -Building multi-architecture images is possible with Harness but differs based on your infrastructure type. Please choose the infrastructure that is right for you. +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). -## Cloud Infrastructure +## With DLC -Building multi-architecture images is simple for cloud infrastructures. You will need to enable an environment variable in your `Build and Push an image to Docker` step. To do so: +:::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:support@harness.io). + +::: 1. Open your `Build and Push an image 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). @@ -17,14 +21,23 @@ Building multi-architecture images is simple for cloud infrastructures. You will 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`. -That's it! +## Without DLC -## Self-Managed Infrastructure +:::info Kubernetes Infrastructure -In order to build multi-architecture images with Kubernetes infrastructure, you will need to use BuildX and DLC. To do so you will require the feature flag `CI_ENABLE_DLC_SELF_HOSTED`. To enable this flag, contact [Harness Support](mailto:support@harness.io) +If you're using Kubernetes infrastructure, turn on the feature flag `CI_USE_BUILDX_ON_K8`. To enable this flag, contact [Harness Support](mailto:support@harness.io). -Once this flag is enabled, simply complete the [cloud infrastructure steps above](#cloud-infrastructure) to build multi-architecture images. +::: + +1. Open your `Build and Push an image 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
Deprecated method of building multi-arch images on Kubernetes infrastructure From d6906ca78798e62a40bb545f2222f2c4997db9e4 Mon Sep 17 00:00:00 2001 From: SushrutHarness <155578943+SushrutHarness@users.noreply.github.com> Date: Tue, 15 Jul 2025 17:07:21 -0700 Subject: [PATCH 4/5] Update docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md Co-authored-by: Dewan Ishtiaque Ahmed <30604461+dewan-ahmed@users.noreply.github.com> --- .../use-ci/build-and-upload-artifacts/build-multi-arch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md b/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md index 13b7a49ff0f..7a071346d04 100644 --- a/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md +++ b/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md @@ -14,7 +14,7 @@ If you're using self-hosted infrastructure, turn on the feature flag `CI_ENABLE_ ::: -1. Open your `Build and Push an image to Docker Registry` step. +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**. From e01ebb395ac62f927cdb8010e49b804233c31ffa Mon Sep 17 00:00:00 2001 From: SushrutHarness <155578943+SushrutHarness@users.noreply.github.com> Date: Tue, 15 Jul 2025 17:07:27 -0700 Subject: [PATCH 5/5] Update docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md Co-authored-by: Dewan Ishtiaque Ahmed <30604461+dewan-ahmed@users.noreply.github.com> --- .../use-ci/build-and-upload-artifacts/build-multi-arch.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md b/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md index 7a071346d04..1e9371aefe1 100644 --- a/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md +++ b/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-multi-arch.md @@ -29,7 +29,7 @@ If you're using Kubernetes infrastructure, turn on the feature flag `CI_USE_BUIL ::: -1. Open your `Build and Push an image to Docker Registry` step. +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**.