Skip to content

Commit 19e956c

Browse files
authored
Merge pull request #107 from phenixblue/multi-arch-builds
Add multi-arch config for buildx action
2 parents 80a6253 + d8b61d9 commit 19e956c

File tree

2 files changed

+29
-4
lines changed

2 files changed

+29
-4
lines changed

.github/workflows/ci-image-build.yaml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ on:
55
# Dynamic releasetag tag is set based on the assumption this ci task only runs on release
66
types: [published]
77

8+
# Variables to be used throughout the workflow manifest
9+
env:
10+
TARGET_PLATFORMS: linux/amd64,linux/arm64,linux/ppc64le
11+
812
jobs:
13+
914
# Build and push magtape-init container image
1015
build-magtape-init-image:
1116
name: Build and push magtape-init images to DockerHub
@@ -22,6 +27,10 @@ jobs:
2227
# GITHUB_REF variable must exist in action; this may rely on {{ on: release: types: [published] }} gating the action
2328
run: |
2429
echo ::set-output name=releasetag::${GITHUB_REF#refs/tags/}
30+
31+
# Setup QEMU to support multi-arch builds
32+
- name: Set up QEMU
33+
uses: docker/setup-qemu-action@v1
2534

2635
# Part of docker/build-push-action@v2; setting up the build system
2736
- name: Set up Docker Buildx
@@ -36,12 +45,14 @@ jobs:
3645

3746
- name: Build and push magtape-init image to DockerHub
3847
if: github.repository == 'tmobile/magtape'
39-
timeout-minutes: 10
48+
timeout-minutes: 30
4049
uses: docker/build-push-action@v2
4150
with:
4251
context: ./app/magtape-init/
4352
# file should be specified relative to the repo root rather than relative to the context
4453
file: ./app/magtape-init/Dockerfile
54+
# Defines the target platform architectures images should be built for
55+
platforms: ${{ env.TARGET_PLATFORMS }}
4556
# push is no longer defaulted to true under v2; to push you must specify push is true
4657
push: true
4758
# Uses the releasetag output exposed by the Collect Release Tag step to set the tag under v2
@@ -64,6 +75,10 @@ jobs:
6475
run: |
6576
echo ::set-output name=releasetag::${GITHUB_REF#refs/tags/}
6677
78+
# Setup QEMU to support multi-arch builds
79+
- name: Set up QEMU
80+
uses: docker/setup-qemu-action@v1
81+
6782
# Part of docker/build-push-action@v2; setting up the build system
6883
- name: Set up Docker Buildx
6984
uses: docker/setup-buildx-action@v1
@@ -77,12 +92,14 @@ jobs:
7792

7893
- name: Build and push magtape image to DockerHub
7994
if: github.repository == 'tmobile/magtape'
80-
timeout-minutes: 10
95+
timeout-minutes: 30
8196
uses: docker/build-push-action@v2
8297
with:
8398
context: ./app/magtape/
8499
# file should be specified relative to the repo root rather than relative to the context
85100
file: ./app/magtape/Dockerfile
101+
# Defines the target platform architectures images should be built for
102+
platforms: ${{ env.TARGET_PLATFORMS }}
86103
# push is no longer defaulted to true under v2; to push you must specify push is true
87104
push: true
88105
# Uses the releasetag output exposed by the Collect Release Tag step to set the tag under v2

docs/release.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ CHANGELOG.md snippet.
7575

7676
NOTE: You may have to adjust the Markdown Headers (ie. `#`) since the Headers for a specific release in the CHANGELOG.md file are not top level (ie. They start with `##` instead of `#`)
7777

78-
## Notes
78+
## Container Images
7979

80-
- The tmobile/magtape-init and tmobile/magtape Docker images are automatically built and published to Docker Hub when a release is created. There are no manual steps involved here.
80+
The `tmobile/magtape-init` and `tmobile/magtape` Docker images are automatically built and published to Docker Hub when a release is created.
81+
82+
Images are published for the following platforms:
83+
84+
- linux/amd64
85+
- linux/arm64
86+
- linux/ppc64le
87+
88+
There are no manual steps involved here.

0 commit comments

Comments
 (0)