From 13fb99dd07efb743b54d2ef049ce5497eca4a536 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 May 2026 08:47:39 +0000 Subject: [PATCH] Apply immich Dockerfile fixes to immich-cuda and immich-noml Agent-Logs-Url: https://github.com/alexbelgium/hassio-addons/sessions/64051758-bdce-40a4-bcae-88a3f3268f0a Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com> --- immich_cuda/Dockerfile | 26 ++++++++++++++++---------- immich_noml/Dockerfile | 26 ++++++++++++++++---------- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/immich_cuda/Dockerfile b/immich_cuda/Dockerfile index cd92bf8623..9607cfb518 100644 --- a/immich_cuda/Dockerfile +++ b/immich_cuda/Dockerfile @@ -37,18 +37,18 @@ RUN chmod 744 /ha_lsio.sh && if grep -qr "lsio" /etc; then /ha_lsio.sh "$CONFIGL # Install REDIS ENV DOCKER_MODS="imagegenius/mods:universal-redis" -# && chmod 777 -R /docker-mods \ -# && /./docker-mods/* || ls / \ -# && if [ !-f /defaults/redis.conf ]; then echo "Not installed" && exit 1; fi -#ENV DOCKER_MODS="" - ################## # 3 Install apps # ################## # Add rootfs COPY rootfs/ / -RUN find . -type f \( -name "*.sh" -o -name "run" -o -name "finish" \) -print -exec chmod +x {} \; + +# FIX BUG 1: scope find to HA-owned directories only, never the whole filesystem. +# Running `find .` from WORKDIR=/ hits node_modules inside /app/immich and fails chmod (exit 1). +RUN find /etc /usr/local/bin /usr/local/lib /usr/local/share \ + -type f \( -name "*.sh" -o -name "run" -o -name "finish" \) \ + -exec chmod +x {} \; 2>/dev/null || true # Uses /bin for compatibility purposes # hadolint ignore=DL4005 @@ -63,7 +63,7 @@ COPY ha_automodules.sh /ha_automodules.sh RUN chmod 744 /ha_automodules.sh && /ha_automodules.sh "$MODULES" && rm /ha_automodules.sh # Manual apps -ENV PACKAGES="sudo sed yamllint pip jq" +ENV PACKAGES="sudo yamllint pip sed jq" # Automatic apps & bashio COPY ha_autoapps.sh /ha_autoapps.sh @@ -82,10 +82,16 @@ RUN chmod 777 /ha_entrypoint.sh COPY bashio-standalone.sh /usr/local/lib/bashio-standalone.sh RUN chmod 0755 /usr/local/lib/bashio-standalone.sh -RUN apt-get update && apt-get install -y --no-install-recommends sed \ - && sed -i "s|postgresql-16|postgresql-15|g" /etc/s6-overlay/s6-rc.d/init-test-run/run +# FIX BUG 2: /etc/s6-overlay/s6-rc.d/init-test-run/run no longer exists in the +# imagegenius base image (service was removed). Guard with file existence check. +# The base image already ships postgresql-client-14 through 18, so the redundant +# install is removed. Only the conditional sed is kept for backward compatibility +# in case a future base image re-introduces the file. +RUN if [ -f /etc/s6-overlay/s6-rc.d/init-test-run/run ]; then \ + sed -i "s|postgresql-16|postgresql-15|g" /etc/s6-overlay/s6-rc.d/init-test-run/run; \ + fi -# Install dependencies +# Install dependencies (postgresql-client for psql CLI used in 99-run.sh) SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN apt-get update && apt-get install -y --no-install-recommends \ lsb-release \ diff --git a/immich_noml/Dockerfile b/immich_noml/Dockerfile index cd92bf8623..9607cfb518 100644 --- a/immich_noml/Dockerfile +++ b/immich_noml/Dockerfile @@ -37,18 +37,18 @@ RUN chmod 744 /ha_lsio.sh && if grep -qr "lsio" /etc; then /ha_lsio.sh "$CONFIGL # Install REDIS ENV DOCKER_MODS="imagegenius/mods:universal-redis" -# && chmod 777 -R /docker-mods \ -# && /./docker-mods/* || ls / \ -# && if [ !-f /defaults/redis.conf ]; then echo "Not installed" && exit 1; fi -#ENV DOCKER_MODS="" - ################## # 3 Install apps # ################## # Add rootfs COPY rootfs/ / -RUN find . -type f \( -name "*.sh" -o -name "run" -o -name "finish" \) -print -exec chmod +x {} \; + +# FIX BUG 1: scope find to HA-owned directories only, never the whole filesystem. +# Running `find .` from WORKDIR=/ hits node_modules inside /app/immich and fails chmod (exit 1). +RUN find /etc /usr/local/bin /usr/local/lib /usr/local/share \ + -type f \( -name "*.sh" -o -name "run" -o -name "finish" \) \ + -exec chmod +x {} \; 2>/dev/null || true # Uses /bin for compatibility purposes # hadolint ignore=DL4005 @@ -63,7 +63,7 @@ COPY ha_automodules.sh /ha_automodules.sh RUN chmod 744 /ha_automodules.sh && /ha_automodules.sh "$MODULES" && rm /ha_automodules.sh # Manual apps -ENV PACKAGES="sudo sed yamllint pip jq" +ENV PACKAGES="sudo yamllint pip sed jq" # Automatic apps & bashio COPY ha_autoapps.sh /ha_autoapps.sh @@ -82,10 +82,16 @@ RUN chmod 777 /ha_entrypoint.sh COPY bashio-standalone.sh /usr/local/lib/bashio-standalone.sh RUN chmod 0755 /usr/local/lib/bashio-standalone.sh -RUN apt-get update && apt-get install -y --no-install-recommends sed \ - && sed -i "s|postgresql-16|postgresql-15|g" /etc/s6-overlay/s6-rc.d/init-test-run/run +# FIX BUG 2: /etc/s6-overlay/s6-rc.d/init-test-run/run no longer exists in the +# imagegenius base image (service was removed). Guard with file existence check. +# The base image already ships postgresql-client-14 through 18, so the redundant +# install is removed. Only the conditional sed is kept for backward compatibility +# in case a future base image re-introduces the file. +RUN if [ -f /etc/s6-overlay/s6-rc.d/init-test-run/run ]; then \ + sed -i "s|postgresql-16|postgresql-15|g" /etc/s6-overlay/s6-rc.d/init-test-run/run; \ + fi -# Install dependencies +# Install dependencies (postgresql-client for psql CLI used in 99-run.sh) SHELL ["/bin/bash", "-o", "pipefail", "-c"] RUN apt-get update && apt-get install -y --no-install-recommends \ lsb-release \