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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PcbbgB7A5LLbPuPRjLUouk
This commit is contained in:
Claude
2026-07-04 17:30:09 +00:00
parent 15c5a3b43d
commit f2ae69f4e3
4 changed files with 20 additions and 12 deletions

View File

@@ -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" ]

View File

@@ -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" ]

View File

@@ -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" ]

View File

@@ -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" ]