Skip to content

Commit 76836c8

Browse files
Update multi-platform.md
1 parent 769921c commit 76836c8

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

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

+11-7
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,15 @@ jobs:
101101
## Distribute build across multiple runners
102102

103103
In the previous example, each platform is built on the same runner which can
104-
take a long time depending on the number of platforms and your Dockerfile.
104+
take a long time depending on the number of platforms and your Dockerfile and
105+
because emulating aarch64 (arm64) on x86_64 can take a long time.
105106

106107
To solve this issue you can use a matrix strategy to distribute the build for
107108
each platform across multiple runners and create manifest list using the
108109
[`buildx imagetools create` command](/reference/cli/docker/buildx/imagetools/create.md).
109110

110111
The following workflow will build the image for each platform on a dedicated
111-
runner using a matrix strategy and push by digest. Then, the `merge` job will
112+
runner (adapted to each platform) using a matrix strategy and push by digest. Then, the `merge` job will
112113
create manifest lists and push them to Docker Hub. The [`metadata` action](https://github.com/docker/metadata-action)
113114
is used to set tags and labels.
114115

@@ -123,13 +124,16 @@ env:
123124
124125
jobs:
125126
build:
126-
runs-on: ubuntu-latest
127+
runs-on: ${{ matrix.os }}
127128
strategy:
128129
fail-fast: false
129130
matrix:
130-
platform:
131-
- linux/amd64
132-
- linux/arm64
131+
os: [ubuntu-24.04, ubuntu-24.04-arm]
132+
include:
133+
- platform: linux/amd64
134+
os: ubuntu-24.04
135+
- platform: linux/arm64
136+
os: ubuntu-24.04-arm
133137
steps:
134138
- name: Prepare
135139
run: |
@@ -178,7 +182,7 @@ jobs:
178182
retention-days: 1
179183
180184
merge:
181-
runs-on: ubuntu-latest
185+
runs-on: ubuntu-24.04
182186
needs:
183187
- build
184188
steps:

0 commit comments

Comments
 (0)