From 6bf3e995e20460e56e518d14b8bb9ee6eab76ee9 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 2 Jan 2025 14:25:28 +0100 Subject: [PATCH 1/2] fix: Use Alpine 3.21 for arm v6 and v7 --- .github/workflows/ci.yml | 10 +++++----- docker/Dockerfile | 10 +--------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8af3dd5aa8..7c139c8a84 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,27 +59,27 @@ jobs: password: ${{ secrets.GH_TOKEN }} - name: Docker setup - QEMU - if: (github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')) && github.event_name == 'push' + # if: (github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')) && github.event_name == 'push' uses: docker/setup-qemu-action@v3 with: platforms: all - name: Docker setup - Buildx - if: (github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')) && github.event_name == 'push' + # if: (github.ref == 'refs/heads/dev' || startsWith(github.ref, 'refs/tags/')) && github.event_name == 'push' id: buildx uses: docker/setup-buildx-action@v3 with: version: latest - name: dev - Docker build and push - if: github.ref == 'refs/heads/dev' && github.event_name == 'push' + # if: github.ref == 'refs/heads/dev' && github.event_name == 'push' uses: docker/build-push-action@v6 with: context: . file: docker/Dockerfile - platforms: linux/arm64/v8,linux/amd64,linux/arm/v6,linux/arm/v7,linux/riscv64,linux/386 + platforms: linux/arm/v6 tags: koenkk/zigbee2mqtt:latest-dev,ghcr.io/koenkk/zigbee2mqtt:latest-dev - push: true + push: false build-args: | COMMIT=${{ github.sha }} VERSION=dev diff --git a/docker/Dockerfile b/docker/Dockerfile index 9d805a5c10..e2675ce2a9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,14 +1,6 @@ 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 linux-arm-alpine -FROM alpine:3.21 AS linux-arm64-alpine -FROM alpine:3.21 AS linux-amd64-alpine -FROM alpine:3.21 AS linux-riscv64-alpine -FROM alpine:3.21 AS linux-386-alpine - -FROM linux-${TARGETARCH}-alpine AS base +FROM alpine:3.21 AS base ENV NODE_ENV=production WORKDIR /app From f7485b81d08a326c840f7bd1123ab724dd7a4214 Mon Sep 17 00:00:00 2001 From: Koen Kanters Date: Thu, 2 Jan 2025 14:26:06 +0100 Subject: [PATCH 2/2] u --- docker/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index e2675ce2a9..a866c1decf 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -12,8 +12,8 @@ FROM base AS deps COPY package.json pnpm-lock.yaml ./ # Make and such are needed to compile serialport for riscv64 RUN apk add make gcc g++ python3 linux-headers npm && \ - npm install -g pnpm && \ - pnpm install --frozen-lockfile --no-optional && \ + npm --maxsockets=1 install -g pnpm && \ + pnpm --maxsockets=1 install --frozen-lockfile --no-optional && \ # serialport has outdated prebuilds that appear to fail on some archs, force build on target platform rm -rf `find ./node_modules/.pnpm/ -wholename "*/@serialport/bindings-cpp/prebuilds" -type d` && \ pnpm rebuild @serialport/bindings-cpp