diff --git a/library/koha/Dockerfile b/library/koha/Dockerfile index 8a615f4..eb69ff8 100644 --- a/library/koha/Dockerfile +++ b/library/koha/Dockerfile @@ -19,16 +19,26 @@ RUN apt-get update \ COPY certs/ /usr/local/share/ca-certificates/extra/ RUN update-ca-certificates +# Each step stands alone and fails the build on error: a swallowed failure here once produced a +# "successful" image with no Koha in it. memcached and cron are named explicitly rather than +# trusted to arrive as dependencies of koha-common. RUN curl -fsSL https://debian.koha-community.org/koha/gpg.asc | gpg --dearmor -o /usr/share/keyrings/koha.gpg \ && echo "deb [signed-by=/usr/share/keyrings/koha.gpg] https://debian.koha-community.org/koha ${KOHA_SUITE} main bookworm" \ > /etc/apt/sources.list.d/koha.list \ && apt-get update \ - && apt-get install -y --no-install-recommends koha-common mariadb-client \ - && a2enmod rewrite headers proxy_http cgi deflate >/dev/null \ - && a2dissite 000-default >/dev/null 2>&1 || true \ - && if [ "$KEEP_TRANSLATIONS" != "yes" ]; then rm -rf /usr/share/koha/misc/translator/po; fi \ + && apt-get install -y --no-install-recommends koha-common mariadb-client memcached cron + +RUN a2enmod rewrite headers proxy_http cgi deflate >/dev/null \ + && (a2dissite 000-default >/dev/null 2>&1 || true) + +RUN if [ "$KEEP_TRANSLATIONS" != "yes" ]; then rm -rf /usr/share/koha/misc/translator/po; fi \ && rm -rf /var/lib/apt/lists/* /usr/share/doc/* +# Refuse to produce an image that cannot run. +RUN for c in koha-create koha-plack koha-zebra koha-rebuild-zebra koha-upgrade-schema apache2ctl memcached cron mariadb zebrasrv; do \ + command -v "$c" >/dev/null || { echo "BUILD ERROR: $c is missing from the image" >&2; exit 1; }; \ + done + COPY bootstrap.pl entrypoint.sh /opt/koha-init/ COPY seed/ /opt/koha-init/seed/ RUN chmod 0755 /opt/koha-init/entrypoint.sh && chmod -R a+rX /opt/koha-init diff --git a/library/quickadd/Dockerfile b/library/quickadd/Dockerfile index 9998b35..2cb7623 100644 --- a/library/quickadd/Dockerfile +++ b/library/quickadd/Dockerfile @@ -13,6 +13,8 @@ RUN apt-get update \ COPY certs/ /usr/local/share/ca-certificates/extra/ RUN update-ca-certificates +RUN command -v yaz-client >/dev/null && command -v yaz-marcdump >/dev/null && command -v python3 >/dev/null + RUN useradd --system --uid 10001 --home-dir /app quickadd \ && mkdir -p /app /data && chown quickadd /data COPY app.py index.html /app/