From d465fe1b1f74970e2d328e1fe8d48d3df39098c3 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Sat, 4 Jan 2025 14:28:12 +0100 Subject: [PATCH 1/3] Alpine image: Install NodeJS for Matter binding Signed-off-by: Florian Hotze --- alpine/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 3c13f14f..2e7e8471 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -57,6 +57,7 @@ RUN apk update --no-cache && \ tini \ ttf-dejavu \ openjdk${JAVA_VERSION} \ + nodejs \ unzip \ wget \ zip && \ From 61b961d81b8f81a242bfacbf48c73beaf7c7cc68 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Tue, 7 Jan 2025 19:04:58 +0100 Subject: [PATCH 2/3] Only install NodeJS for openHAB 5 SNAPSHOTs Signed-off-by: Florian Hotze --- alpine/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 2e7e8471..1c675dba 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -41,7 +41,8 @@ SHELL ["/bin/ash", "-eo", "pipefail", "-c"] # Install basepackages. Versions are "pinned" by using a pinned base image. # hadolint ignore=DL3018 -RUN apk update --no-cache && \ +RUN version="$(echo $OPENHAB_VERSION | sed 's/snapshot/SNAPSHOT/g')" && \ + apk update --no-cache && \ apk add --no-cache \ arping \ bash \ @@ -57,10 +58,11 @@ RUN apk update --no-cache && \ tini \ ttf-dejavu \ openjdk${JAVA_VERSION} \ - nodejs \ unzip \ wget \ zip && \ + # Install NodeJS only for openHAB 5 SNAPSHOT + if [ $(echo $version | grep -E '^5\..+-SNAPSHOT$') ]; then apk add --no-cache nodejs; fi && \ chmod u+s /usr/sbin/arping && \ rm -rf /var/cache/apk/* From 7c9b13947a3b6e45ee5eb022f887ffdc96ae7926 Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Tue, 7 Jan 2025 19:20:38 +0100 Subject: [PATCH 3/3] Fix shellcheck Signed-off-by: Florian Hotze --- alpine/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 1c675dba..0aa06cb5 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -41,7 +41,7 @@ SHELL ["/bin/ash", "-eo", "pipefail", "-c"] # Install basepackages. Versions are "pinned" by using a pinned base image. # hadolint ignore=DL3018 -RUN version="$(echo $OPENHAB_VERSION | sed 's/snapshot/SNAPSHOT/g')" && \ +RUN version="$(echo "$OPENHAB_VERSION" | sed 's/snapshot/SNAPSHOT/g')" && \ apk update --no-cache && \ apk add --no-cache \ arping \ @@ -57,12 +57,12 @@ RUN version="$(echo $OPENHAB_VERSION | sed 's/snapshot/SNAPSHOT/g')" && \ su-exec \ tini \ ttf-dejavu \ - openjdk${JAVA_VERSION} \ + openjdk"${JAVA_VERSION}" \ unzip \ wget \ zip && \ # Install NodeJS only for openHAB 5 SNAPSHOT - if [ $(echo $version | grep -E '^5\..+-SNAPSHOT$') ]; then apk add --no-cache nodejs; fi && \ + if [ $(echo "$version" | grep -E '^5\..+-SNAPSHOT$') ]; then apk add --no-cache nodejs; fi && \ chmod u+s /usr/sbin/arping && \ rm -rf /var/cache/apk/*