Skip to content

Commit ec6d849

Browse files
authored
Merge pull request #25086 from crazy-max/github-builder-runner
build: GitHub Builder runner mappings
2 parents 9d2f06b + e79ee7e commit ec6d849

4 files changed

Lines changed: 63 additions & 15 deletions

File tree

content/manuals/build/ci/github-actions/github-builder/architecture.md

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ conditions, permissions, secrets, target selection, metadata inputs, and the
2727
choice between image output and local output.
2828

2929
Inside the reusable workflow, the first phase prepares the build. It validates
30-
the incoming inputs, resolves the appropriate runner, and expands a
31-
multi-platform request into one job per platform. The execution model is
32-
easiest to picture as a matrix where `linux/amd64` runs on `ubuntu-24.04` and
33-
`linux/arm64` runs on `ubuntu-24.04-arm`. Each platform job builds independently,
34-
then the workflow finalizes the result into one caller-facing output contract.
30+
the incoming inputs, resolves the runner config, and expands a multi-platform
31+
request into one job per platform. The execution model is easiest to picture as
32+
a matrix where `linux/amd64` runs on `ubuntu-24.04` and `linux/arm64` runs on
33+
`ubuntu-24.04-arm`. Each platform job builds independently, then the workflow
34+
finalizes the result into one caller-facing output contract.
3535

3636
```yaml
3737
requested platforms:
@@ -42,6 +42,46 @@ conceptual platform jobs:
4242
linux/arm64 -> ubuntu-24.04-arm
4343
```
4444
45+
### Runner selection
46+
47+
The `runner` input accepts either a single GitHub-hosted Linux runner label or a
48+
newline-delimited platform mapping.
49+
50+
The default value is a platform mapping that uses GitHub-hosted Ubuntu runners:
51+
52+
```yaml
53+
runner: |
54+
default=ubuntu-24.04
55+
linux/arm=ubuntu-24.04-arm
56+
linux/arm64=ubuntu-24.04-arm
57+
```
58+
59+
In the platform job, the runner label resolves to a single value:
60+
61+
```yaml
62+
runner: ubuntu-24.04
63+
```
64+
65+
A mapping must define a `default` runner. Other keys are platform prefixes, and
66+
the most specific matching prefix wins. For example, `linux/arm` matches
67+
variants such as `linux/arm/v7`, while `linux/arm64` is a separate prefix:
68+
69+
In the following example, `linux` matches Linux platforms that do not match a
70+
longer prefix. The `default` key is still required because it is the fallback
71+
when no platform prefix matches.
72+
73+
```yaml
74+
runner: |
75+
default=ubuntu-24.04
76+
linux=ubuntu-24.04
77+
linux/arm=ubuntu-24.04-arm
78+
linux/arm64=ubuntu-24.04-arm
79+
```
80+
81+
The reusable workflows require GitHub-hosted Linux runners. The legacy `auto`,
82+
`amd64`, and `arm64` values are still accepted for compatibility, but emit
83+
deprecation warnings. Use an explicit runner label or platform mapping instead.
84+
4585
## Execution path
4686

4787
![GitHub Builder execution flow](./images/execution-flow.png)

content/manuals/build/ci/github-actions/github-builder/bake.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ builds aren't supported because [SLSA provenance](../attestations.md), digest
5858
handling, and manifest creation are scoped to a single target.
5959
6060
The workflow validates the definition before the build starts and resolves
61-
the target from the files you pass in `files`.
61+
the target from the files you pass in `files`. Runner selection uses the same
62+
`runner` input as the Build workflow. Set a single GitHub-hosted Linux runner
63+
label or a platform mapping when the default mapping is not enough. For details,
64+
see [runner selection](architecture.md#runner-selection).
6265

6366
## Override target values and variables
6467

content/manuals/build/ci/github-actions/github-builder/build.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,13 @@ jobs:
5555
5656
When you set `output: image`, `meta-images` is required because the workflow
5757
creates image names and [manifest tags](../manage-tags-labels.md) from that
58-
input. `runner: auto` and `distribute: true` are the defaults, so a
59-
multi-platform build can fan out across native GitHub-hosted runners instead
60-
of forcing the whole build onto one machine. `sign: auto` is also the default,
61-
which means the workflow signs [attestation manifests](../attestations.md)
62-
when the image is pushed.
58+
input. `distribute: true` is the default, so a multi-platform build can fan out
59+
across native GitHub-hosted runners instead of forcing the whole build onto one
60+
machine. The default `runner` mapping sends Linux Arm platforms to
61+
`ubuntu-24.04-arm` and uses `ubuntu-24.04` for other platforms. To change that
62+
mapping, see [runner selection](architecture.md#runner-selection). `sign: auto`
63+
is also the default, which means the workflow signs
64+
[attestation manifests](../attestations.md) when the image is pushed.
6365

6466
## Export local output as an artifact
6567

content/manuals/build/ci/github-actions/multi-platform.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,13 @@ jobs:
140140
password: ${{ secrets.DOCKERHUB_TOKEN }}
141141
```
142142

143-
With `runner: auto` and `distribute: true`, which are the defaults, the
144-
workflow splits the build into one platform per runner and assembles the final
145-
multi-platform image in its finalize phase. If you need to control the Docker
146-
build inputs directly, see [Build with Docker GitHub Builder build.yml](github-builder/build.md).
143+
With `distribute: true`, which is the default, the workflow splits the build
144+
into one platform per runner and assembles the final multi-platform image in
145+
its finalize phase. The default `runner` mapping sends Linux Arm platforms to
146+
`ubuntu-24.04-arm` and uses `ubuntu-24.04` for other platforms. To customize
147+
the mapping, see [runner selection](github-builder/architecture.md#runner-selection).
148+
If you need to control the Docker build inputs directly, see
149+
[Build with Docker GitHub Builder build.yml](github-builder/build.md).
147150

148151
### With Bake
149152

0 commit comments

Comments
 (0)