From f72131cd108b6bfca48b32787691c17173ab0caf Mon Sep 17 00:00:00 2001 From: Philip H <47042125+pheiduck@users.noreply.github.com> Date: Thu, 13 Jun 2024 20:12:10 +0200 Subject: [PATCH] Dockerfile: use native nodejs 20 LTS for build as well Thanks @pabra --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ca427af2..87972f58 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,8 @@ # As a workaround we have to build on nodejs 18 # nodejs 20 hangs on build with armv6/armv7 -FROM docker.io/library/node:18-alpine AS build_node_modules +ARG BASE_IMAGE=node:20-alpine + +FROM --platform=$BUILDPLATFORM ${BASE_IMAGE} AS build_node_modules # Update npm to latest RUN npm install -g npm@latest @@ -13,7 +15,7 @@ RUN npm ci --omit=dev &&\ # Copy build result to a new image. # This saves a lot of disk space. -FROM docker.io/library/node:20-alpine +FROM --platform=$BUILDPLATFORM ${BASE_IMAGE} HEALTHCHECK CMD /usr/bin/timeout 5s /bin/sh -c "/usr/bin/wg show | /bin/grep -q interface || exit 1" --interval=1m --timeout=5s --retries=3 COPY --from=build_node_modules /app /app