From 15c5a3b43dcce5c959abf1e2fedb653854d6a96e Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 4 Jul 2026 17:23:18 +0000 Subject: [PATCH 1/2] Immich: fix build failure by dropping the redundant postgresql-client install The imagegenius v3 base image moved to a newer Ubuntu release where the apt-key binary no longer exists, breaking the Dockerfiles' manual PGDG-repo install of postgresql-client-15 (`wget ... | apt-key add -`). That install was already redundant: imagegenius's own Dockerfile installs postgresql-client-14 through 18 itself (via the modern signed-by keyring method), so the psql CLI used by 99-run.sh is already present in the base image. Remove the downstream install entirely rather than patching it to use a keyring, since it duplicated work the base image already does. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01PcbbgB7A5LLbPuPRjLUouk --- immich/Dockerfile | 14 ++++---------- immich_cuda/Dockerfile | 14 ++++---------- immich_noml/Dockerfile | 14 ++++---------- immich_openvino/Dockerfile | 14 ++++---------- 4 files changed, 16 insertions(+), 40 deletions(-) diff --git a/immich/Dockerfile b/immich/Dockerfile index 9607cfb518..a09eda0b3d 100644 --- a/immich/Dockerfile +++ b/immich/Dockerfile @@ -91,16 +91,10 @@ 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 (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 \ - wget \ - gnupg && \ - echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \ - wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ - apt-get update && \ - apt-get install -y --no-install-recommends postgresql-client-15 +# postgresql-client (for the psql CLI used in 99-run.sh) is already installed by the +# imagegenius base image (postgresql-client-14 through 18), so no separate install is +# needed here. A previous PGDG-repo install using `apt-key add` was removed: the base +# image moved to a release where the apt-key binary no longer exists, breaking the build. #ENTRYPOINT [ "/usr/bin/env" ] #CMD [ "/ha_entrypoint.sh" ] diff --git a/immich_cuda/Dockerfile b/immich_cuda/Dockerfile index 9607cfb518..a09eda0b3d 100644 --- a/immich_cuda/Dockerfile +++ b/immich_cuda/Dockerfile @@ -91,16 +91,10 @@ 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 (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 \ - wget \ - gnupg && \ - echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \ - wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ - apt-get update && \ - apt-get install -y --no-install-recommends postgresql-client-15 +# postgresql-client (for the psql CLI used in 99-run.sh) is already installed by the +# imagegenius base image (postgresql-client-14 through 18), so no separate install is +# needed here. A previous PGDG-repo install using `apt-key add` was removed: the base +# image moved to a release where the apt-key binary no longer exists, breaking the build. #ENTRYPOINT [ "/usr/bin/env" ] #CMD [ "/ha_entrypoint.sh" ] diff --git a/immich_noml/Dockerfile b/immich_noml/Dockerfile index 9607cfb518..a09eda0b3d 100644 --- a/immich_noml/Dockerfile +++ b/immich_noml/Dockerfile @@ -91,16 +91,10 @@ 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 (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 \ - wget \ - gnupg && \ - echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \ - wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ - apt-get update && \ - apt-get install -y --no-install-recommends postgresql-client-15 +# postgresql-client (for the psql CLI used in 99-run.sh) is already installed by the +# imagegenius base image (postgresql-client-14 through 18), so no separate install is +# needed here. A previous PGDG-repo install using `apt-key add` was removed: the base +# image moved to a release where the apt-key binary no longer exists, breaking the build. #ENTRYPOINT [ "/usr/bin/env" ] #CMD [ "/ha_entrypoint.sh" ] diff --git a/immich_openvino/Dockerfile b/immich_openvino/Dockerfile index 32dad96acb..4eaed3206d 100644 --- a/immich_openvino/Dockerfile +++ b/immich_openvino/Dockerfile @@ -91,16 +91,10 @@ 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 (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 \ - wget \ - gnupg && \ - echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list && \ - wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ - apt-get update && \ - apt-get install -y --no-install-recommends postgresql-client-15 +# postgresql-client (for the psql CLI used in 99-run.sh) is already installed by the +# imagegenius base image (postgresql-client-14 through 18), so no separate install is +# needed here. A previous PGDG-repo install using `apt-key add` was removed: the base +# image moved to a release where the apt-key binary no longer exists, breaking the build. #ENTRYPOINT [ "/usr/bin/env" ] #CMD [ "/ha_entrypoint.sh" ] From f2ae69f4e3ea1dc2b9ab14c05ca1f4fecd539a6f Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 4 Jul 2026 17:30:09 +0000 Subject: [PATCH 2/2] Immich: fail the build early if the base image ever drops postgresql-client Per Copilot review feedback on #2807: add a build-time assertion for `psql` so a future base-image change that drops postgresql-client is caught at `docker build` time with a clear error, instead of surfacing as a cryptic runtime failure in 99-run.sh. Also drop the hard-coded "14 through 18" client version range from the comment, since that's specific to the current base image and could go stale. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01PcbbgB7A5LLbPuPRjLUouk --- immich/Dockerfile | 8 +++++--- immich_cuda/Dockerfile | 8 +++++--- immich_noml/Dockerfile | 8 +++++--- immich_openvino/Dockerfile | 8 +++++--- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/immich/Dockerfile b/immich/Dockerfile index a09eda0b3d..67f28bbcf3 100644 --- a/immich/Dockerfile +++ b/immich/Dockerfile @@ -92,9 +92,11 @@ RUN if [ -f /etc/s6-overlay/s6-rc.d/init-test-run/run ]; then \ fi # postgresql-client (for the psql CLI used in 99-run.sh) is already installed by the -# imagegenius base image (postgresql-client-14 through 18), so no separate install is -# needed here. A previous PGDG-repo install using `apt-key add` was removed: the base -# image moved to a release where the apt-key binary no longer exists, breaking the build. +# imagegenius base image, so no separate install is needed here. A previous PGDG-repo +# install using `apt-key add` was removed: the base image moved to a release where the +# apt-key binary no longer exists, breaking the build. Fail the build early, rather than +# surfacing a cryptic runtime failure in 99-run.sh, if a future base image drops it. +RUN command -v psql || { echo "psql not found in base image; postgresql-client must be provided by the upstream base image" >&2; exit 1; } #ENTRYPOINT [ "/usr/bin/env" ] #CMD [ "/ha_entrypoint.sh" ] diff --git a/immich_cuda/Dockerfile b/immich_cuda/Dockerfile index a09eda0b3d..67f28bbcf3 100644 --- a/immich_cuda/Dockerfile +++ b/immich_cuda/Dockerfile @@ -92,9 +92,11 @@ RUN if [ -f /etc/s6-overlay/s6-rc.d/init-test-run/run ]; then \ fi # postgresql-client (for the psql CLI used in 99-run.sh) is already installed by the -# imagegenius base image (postgresql-client-14 through 18), so no separate install is -# needed here. A previous PGDG-repo install using `apt-key add` was removed: the base -# image moved to a release where the apt-key binary no longer exists, breaking the build. +# imagegenius base image, so no separate install is needed here. A previous PGDG-repo +# install using `apt-key add` was removed: the base image moved to a release where the +# apt-key binary no longer exists, breaking the build. Fail the build early, rather than +# surfacing a cryptic runtime failure in 99-run.sh, if a future base image drops it. +RUN command -v psql || { echo "psql not found in base image; postgresql-client must be provided by the upstream base image" >&2; exit 1; } #ENTRYPOINT [ "/usr/bin/env" ] #CMD [ "/ha_entrypoint.sh" ] diff --git a/immich_noml/Dockerfile b/immich_noml/Dockerfile index a09eda0b3d..67f28bbcf3 100644 --- a/immich_noml/Dockerfile +++ b/immich_noml/Dockerfile @@ -92,9 +92,11 @@ RUN if [ -f /etc/s6-overlay/s6-rc.d/init-test-run/run ]; then \ fi # postgresql-client (for the psql CLI used in 99-run.sh) is already installed by the -# imagegenius base image (postgresql-client-14 through 18), so no separate install is -# needed here. A previous PGDG-repo install using `apt-key add` was removed: the base -# image moved to a release where the apt-key binary no longer exists, breaking the build. +# imagegenius base image, so no separate install is needed here. A previous PGDG-repo +# install using `apt-key add` was removed: the base image moved to a release where the +# apt-key binary no longer exists, breaking the build. Fail the build early, rather than +# surfacing a cryptic runtime failure in 99-run.sh, if a future base image drops it. +RUN command -v psql || { echo "psql not found in base image; postgresql-client must be provided by the upstream base image" >&2; exit 1; } #ENTRYPOINT [ "/usr/bin/env" ] #CMD [ "/ha_entrypoint.sh" ] diff --git a/immich_openvino/Dockerfile b/immich_openvino/Dockerfile index 4eaed3206d..8a61369dd5 100644 --- a/immich_openvino/Dockerfile +++ b/immich_openvino/Dockerfile @@ -92,9 +92,11 @@ RUN if [ -f /etc/s6-overlay/s6-rc.d/init-test-run/run ]; then \ fi # postgresql-client (for the psql CLI used in 99-run.sh) is already installed by the -# imagegenius base image (postgresql-client-14 through 18), so no separate install is -# needed here. A previous PGDG-repo install using `apt-key add` was removed: the base -# image moved to a release where the apt-key binary no longer exists, breaking the build. +# imagegenius base image, so no separate install is needed here. A previous PGDG-repo +# install using `apt-key add` was removed: the base image moved to a release where the +# apt-key binary no longer exists, breaking the build. Fail the build early, rather than +# surfacing a cryptic runtime failure in 99-run.sh, if a future base image drops it. +RUN command -v psql || { echo "psql not found in base image; postgresql-client must be provided by the upstream base image" >&2; exit 1; } #ENTRYPOINT [ "/usr/bin/env" ] #CMD [ "/ha_entrypoint.sh" ]