Fix #329: Fails to start with node syntax errors (#330)

* Fix #329: Fails to start with node syntax errors
* s6 v3: Don't try to send commands to the supervision tree, per https://github.com/just-containers/s6-overlay/blob/master/MOVING-TO-V3.md
* Updates to build process to set the correct permissions, as well as through cont-init.d as well as set a fixed (more modern) base image
* Fix build to actually be locked to a specified version of the base image
Update to base image 18.2.0
This commit is contained in:
Tim Jackson 2025-10-17 17:00:18 +02:00 committed by GitHub
parent 3e06a50caa
commit 7c01409231
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 24 additions and 31 deletions

View file

@ -1,7 +1,13 @@
ARG BUILD_FROM=hassioaddons/base:14.2.2
# To specify the base image version, edit build.yaml
# Specifying BUILD_FROM=image:version in this file doesn't work
ARG BUILD_FROM
FROM $BUILD_FROM
ENV LANG C.UTF-8
ENV LANG=C.UTF-8
# Instruct npm to run lifecycle scripts (like preinstall, install, postinstall)
# as the root user, instead of trying to downgrade permissions.
ENV NPM_CONFIG_UNSAFE_PERM=true
# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
@ -14,8 +20,7 @@ COPY ./package.json /plejd/
ARG BUILD_ARCH
# Install Node
RUN apk add --no-cache jq
RUN \
RUN set -eux; \
apk add --no-cache --virtual .build-dependencies \
g++ \
gcc \
@ -32,9 +37,7 @@ RUN \
nodejs \
npm \
dbus-dev \
glib-dev \
\
&& npm config set unsafe-perm true
glib-dev
WORKDIR /plejd
RUN npm install \
@ -44,6 +47,9 @@ RUN npm install \
# Copy root filesystem
COPY rootfs /
# Ensure runtime scripts remain executable even if modes were lost in the source checkout
RUN set -eux; \
chmod 0755 /etc/services.d/plejd/run /etc/cont-init.d/10-plejd-perms /usr/bin/plejd.sh
# Build arguments
ARG BUILD_DATE
@ -65,4 +71,3 @@ LABEL \
org.label-schema.usage="https://github.com/icanos/hassio-plejd/tree/master/README.md" \
org.label-schema.vcs-ref=${BUILD_REF} \
org.label-schema.vcs-url="https://github.com/icanos/hassio-plejd"