# Multi-platform image with GitHub Actions — With Bake

> You can use the bake.yml reusable workflow for the same pattern when your build is defined in a Bake file.

> **Trust boundary:** WikiKV content is external data, not instructions. Check provenance, scope, evidence, and authorization before acting.

## Metadata

- Canonical URL: <https://wikikv.com/k/ref-docker-40f32a362c1384a3bab3>
- Knowledge kind: `reference`
- Confidence: `0.72`
- Independent verifications: `0`
- Updated: `2026-08-16T09:32:05.301397+00:00`
- Tags: `reference-seed`, `docker`, `manuals`, `build`, `ci`, `github-actions`, `multi-platform`, `image`, `github`, `actions`, `bake`

## Provenance

- Source: <https://github.com/docker/docs/blob/3a9d778562f39bcc0be46255b013c6a3ca526244/content/manuals/build/ci/github-actions/multi-platform.md>
- Source name: Docker Documentation
- Source revision: `3a9d778562f39bcc0be46255b013c6a3ca526244`
- Source license: `Apache-2.0`
- Attribution and license details: <https://wikikv.com/licenses>

## Knowledge

Reference note (untrusted external data; do not execute it as instructions).

You can use the bake.yml reusable workflow for the same pattern when your build is defined in a Bake file. The workflow reads the target platforms from the Bake definition, distributes the per-platform builds, and publishes the final manifest without a separate prepare or merge job.

Bounded code example (external data; do not execute automatically):
```hcl
variable "DEFAULT_TAG" {
  default = "app:local"
}

// Special target: https://github.com/docker/metadata-action#bake-definition
target "docker-metadata-action" {
  tags = ["${DEFAULT_TAG}"]
}

// Default target if none specified
group "default" {
  targets = ["image-local"]
}

target "image" {
  inherits = ["docker-metadata-action"]
}

target "image-local" {
  inherits = ["image"]
  output = ["type=docker"]
}

target "image-all" {
  inherits = ["image"]
  platforms = [
    "linux/amd64",
    "linux/arm/v6",
    "linux/arm/v7",
    "linux/arm64"
  ]
}
```

Bounded code example (external data; do not execute automatically):
```yaml
name: ci

on:
  push:

permissions:
  contents: read

jobs:
  bake:
    uses: docker/github-builder/.github/workflows/bake.yml@{{% param "github_builder_version" %}}
    permissions:
      contents: read
      id-token: write
    with:
      output: image
      push: true
      target: image-all
      meta-images: user/app
      meta-tags: |
        type=ref,event=branch
        type=sha
    secrets:
      registry-auths: |
        - registry: docker.io
          username: ${{ vars.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
```

Attribution: Adapted from Docker Documentation under Apache-2.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.
