diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8b4f5b39e4..d9b367b436 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,7 +77,7 @@ jobs: with: context: . file: docker/Dockerfile - platforms: linux/arm64/v8,linux/386,linux/amd64,linux/arm/v6,linux/arm/v7 + platforms: linux/arm64/v8,linux/amd64,linux/arm/v6,linux/arm/v7 tags: koenkk/zigbee2mqtt:latest-dev,ghcr.io/koenkk/zigbee2mqtt:latest-dev push: true build-args: | @@ -92,7 +92,7 @@ jobs: context: . file: docker/Dockerfile provenance: false - platforms: linux/arm64/v8,linux/386,linux/amd64,linux/arm/v6,linux/arm/v7 + platforms: linux/arm64/v8,linux/amd64,linux/arm/v6,linux/arm/v7 tags: koenkk/zigbee2mqtt:latest,ghcr.io/koenkk/zigbee2mqtt:latest,koenkk/zigbee2mqtt:${{ github.ref_name }},ghcr.io/koenkk/zigbee2mqtt:${{ github.ref_name }} push: true build-args: | diff --git a/docker/Dockerfile b/docker/Dockerfile index 614d98ecf8..f6b6990fd1 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,12 @@ -FROM alpine:3.18.4 AS base +ARG TARGETPLATFORM + +# Need to use Alpine 3.18.4 which uses Node 18 for arm/v6 and arm/v7, otherwise the build hangs. +# See https://github.com/nodejs/docker-node/issues/2077 +FROM alpine:3.18.4 AS arm-alpine +FROM alpine:3.21 AS arm64-alpine +FROM alpine:3.21 AS amd64-alpine + +FROM ${TARGETARCH}-alpine AS base ENV NODE_ENV=production WORKDIR /app @@ -8,7 +16,7 @@ RUN apk add --no-cache tzdata eudev tini nodejs FROM base AS deps COPY package.json pnpm-lock.yaml ./ -RUN apk add make gcc g++ python3 linux-headers npm && \ +RUN apk add npm && \ npm install -g pnpm && \ pnpm install --frozen-lockfile --no-optional @@ -18,7 +26,7 @@ FROM base AS release ARG DATE ARG VERSION LABEL org.opencontainers.image.authors="Koen Kanters" -LABEL org.opencontainers.image.title="zigbee2mqtt" +LABEL org.opencontainers.image.title="Zigbee2MQTT" LABEL org.opencontainers.image.description="Zigbee to MQTT bridge using Zigbee-herdsman" LABEL org.opencontainers.image.url="https://github.com/Koenkk/zigbee2mqtt" LABEL org.opencontainers.image.documentation="https://www.zigbee2mqtt.io/"