github.com/GoogleContainerTools/skaffold/v2@v2.13.2/docs-v2/content/en/docs/builders/cross-platform.md (about)

     1  ---
     2  title: "Cross-platform and multi-platform build support"
     3  linkTitle: "Cross/multi-platform"
     4  weight: 40
     5  ---
     6  
     7  Skaffold selectively supports building for an architecture that is different than the development machine architecture (`cross-platform` build) or building for multiple architectures (`multiple-platform` build). The target platforms for an artifact can be specified in one of the following ways:
     8  
     9  - The pipeline's `platforms` property in the `skaffold.yaml` file.
    10  {{% readfile file="samples/builders/platforms/pipeline-constraints.yaml" %}}
    11  
    12  - The artifact's `platforms` constraints in the `skaffold.yaml` file. This overrides the value specified in the pipeline's `platforms` property.
    13  {{% readfile file="samples/builders/platforms/artifact-constraints.yaml" %}}
    14  
    15  - The CLI flag `--platform` which overrides the values set in both the previous ways.
    16  
    17  ```cmd
    18  skaffold build --platform=linux/arm64,linux/amd64
    19  ```
    20  
    21  Additionally, for `skaffold dev`, `skaffold debug` and `skaffold run` commands, where the build output gets deployed immediately, skaffold checks the platform for the kubernetes cluster nodes and attempts to build artifacts for that target platform.
    22  
    23  The final list of target platforms need to ultimately be supported by the target builder, otherwise it'll fail the build. The cross-platform build support for the various builders can be summarized in the following table:
    24  
    25  |    | Local Build | In Cluster Build | Remote on Google Cloud Build |
    26  |----|:-----------:|:----------------:|:----------------------------:|
    27  | **Dockerfile** | Cross-platform and multi-platform supported | Cross-platform supported but platform should match cluster node running the pod. | Cross-platform and multi-platform supported |
    28  | **Jib Maven and Gradle** | Cross-platform and multi-platform supported | - | Cross-platform and multi-platform supported |
    29  | **Cloud Native Buildpacks** | Only supports `linux/amd64` | - | Only supports `linux/amd64` |
    30  | **Bazel** | Cross-platform supported | - | - |
    31  | **ko** | Cross-platform and multi-platform supported | - | Cross-platform and multi-platform supported |
    32  | **Custom Script** | Cross-platform and multi-platform supported but requires user to implement it in the build script | Cross-platform and multi-platform supported but requires user to implement it in the build script | - |
    33  
    34  {{< alert title="Note" >}}
    35  Skaffold supports multi-platform image builds natively for the [jib builder]({{<relref "/docs/builders/builder-types/jib" >}}), the [ko builder]({{<relref "/docs/builders/builder-types/ko">}}) and the [custom builder]({{<relref "/docs/builders/builder-types/custom" >}}). For other builders that support building cross-architecture images, Skaffold will iteratively build a single platform image for each target architecture and stitch them together into a multi-platform image, and push it to the registry.
    36  {{< /alert >}}