Skip to content

CICD-118 · Build for one foreign architecture ​

Encyclopedia · Docker image building · All snippets

Previous · CICD-117 · Next · CICD-119

1. Where it fits ​

  • Placement Bash run step following checkout, or equivalent lab terminal.
  • Prerequisites Docker Engine or BuildKit on a trusted lab runner.
  • Platforms local-linux, github-actions, gitea-actions.

2. Copy the snippet ​

bash
docker buildx build --platform linux/arm64 --output type=oci,dest=web-arm64.tar .

3. How it works ​

Buildx executes BuildKit for the declared targets. The output option determines whether the result appears in a local image store, archive, or registry. The command archives or inspects the selected files. Verify the relative paths and file set before using the archive downstream.

Buildx targets an architecture independently from the scheduler running the job.

flowchart TD
  N1["Source and Dockerfile"]
  N2["Buildx"]
  N1 --> N2
  N3["ARM64 worker or emulator"]
  N3 --> N2
  N4["OCI archive"]
  N2 --> N4
  N5["ARM64 validation"]
  N4 --> N5
  classDef trigger fill:#EFF6FF,stroke:#0540F2,color:#0A0A0A
  classDef build fill:#CCFBF1,stroke:#0D9488,color:#0A0A0A
  classDef test fill:#EEF2FF,stroke:#4F46E5,color:#0A0A0A
  classDef gate fill:#FEF3C7,stroke:#D97706,color:#0A0A0A
  classDef security fill:#EDE9FE,stroke:#7C3AED,color:#0A0A0A
  classDef deploy fill:#D1FAE5,stroke:#059669,color:#0A0A0A
  classDef fail fill:#FEE2E2,stroke:#DC2626,color:#0A0A0A
  class N1 trigger
  class N2,N3,N4 build
  class N5 test

4. Verify the result ​

Use native workers or installed emulation. Validate the output on real ARM64 before promotion.

Validation syntax-validated (Bash parse). Status definitions.