Skip to content

Commit acd9d13

Browse files
committed
fix(ha-addon): multi-arch HA base + armhf build.yaml
1 parent 13f6ea4 commit acd9d13

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

ha-addon/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG BUILD_FROM=ghcr.io/home-assistant/amd64-base:latest
1+
ARG BUILD_FROM=ghcr.io/home-assistant/base:3.23
22
FROM $BUILD_FROM
33

44
# Redefine NODE_ENV to development for the build phase
@@ -43,7 +43,8 @@ RUN npm run build -w server
4343
ENV NODE_ENV=production
4444
RUN npm prune --production
4545

46-
RUN npm install --no-save --os=linux --cpu=x64 sharp -w server
46+
RUN case "$(uname -m)" in aarch64|arm64) cpu=arm64 ;; armv7l|armv6l|armhf) cpu=arm ;; *) cpu=x64 ;; esac \
47+
&& npm install --no-save --os=linux --cpu="$cpu" sharp -w server
4748

4849
# Link to run.sh
4950
COPY ha-addon/run.sh /

ha-addon/build.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
# Supervisor passes BUILD_FROM from this map; 32-bit ARM still uses arch-prefixed base images.
3+
build_from:
4+
aarch64: ghcr.io/home-assistant/base:3.23
5+
amd64: ghcr.io/home-assistant/base:3.23
6+
armhf: ghcr.io/home-assistant/armhf-base:latest
7+
armv7: ghcr.io/home-assistant/armhf-base:latest

0 commit comments

Comments
 (0)