Skip to content

Commit 30ae9ce

Browse files
authored
Use native ARM builder for aarch64 image (#177)
* Use native ARM builder for aarch64 image * Don't pin builder arch, remove unsupported architectures from Dockerfile
1 parent 223546c commit 30ae9ce

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

.github/workflows/builder.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,18 @@ jobs:
4545
build:
4646
name: Build ${{ matrix.arch }} plugin
4747
needs: init
48-
runs-on: ubuntu-latest
48+
runs-on: ${{ matrix.runs-on }}
4949
permissions:
5050
contents: read
5151
packages: write
5252
id-token: write
5353
strategy:
5454
matrix:
5555
arch: ${{ fromJson(needs.init.outputs.architectures) }}
56+
include:
57+
- runs-on: ubuntu-24.04
58+
- arch: aarch64
59+
runs-on: ubuntu-24.04-arm
5660
steps:
5761
- name: Checkout the repository
5862
uses: actions/checkout@v6.0.2
@@ -72,6 +76,7 @@ jobs:
7276
- name: Build plugin
7377
uses: home-assistant/builder@2025.11.0
7478
with:
79+
image: ${{ matrix.arch }}
7580
args: |
7681
$BUILD_ARGS \
7782
--${{ matrix.arch }} \

Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG BUILD_FROM
22

3-
FROM --platform=amd64 golang:1.23.3-alpine3.20 AS builder
3+
FROM golang:1.23.3-alpine3.20 AS builder
44

55
WORKDIR /usr/src
66
ARG BUILD_ARCH
@@ -30,14 +30,8 @@ RUN \
3030
&& go mod tidy \
3131
&& go generate \
3232
&& \
33-
if [ "${BUILD_ARCH}" = "armhf" ]; then \
34-
make coredns SYSTEM="CGO_ENABLED=0 GOOS=linux GOARM=6 GOARCH=arm"; \
35-
elif [ "${BUILD_ARCH}" = "armv7" ]; then \
36-
make coredns SYSTEM="CGO_ENABLED=0 GOOS=linux GOARM=7 GOARCH=arm"; \
37-
elif [ "${BUILD_ARCH}" = "aarch64" ]; then \
33+
if [ "${BUILD_ARCH}" = "aarch64" ]; then \
3834
make coredns SYSTEM="CGO_ENABLED=0 GOOS=linux GOARCH=arm64"; \
39-
elif [ "${BUILD_ARCH}" = "i386" ]; then \
40-
make coredns SYSTEM="CGO_ENABLED=0 GOOS=linux GOARCH=386"; \
4135
elif [ "${BUILD_ARCH}" = "amd64" ]; then \
4236
make coredns SYSTEM="CGO_ENABLED=0 GOOS=linux GOARCH=amd64"; \
4337
else \

0 commit comments

Comments
 (0)