From 07f7c6b812e98db0e46f7d5e4ec0f6db8c54f24b Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Sun, 27 Oct 2024 16:33:37 -0700 Subject: [PATCH] Reinstate jbig2 building --- .docker/Dockerfile | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/.docker/Dockerfile b/.docker/Dockerfile index 6df10e3ce..a5b0f4707 100644 --- a/.docker/Dockerfile +++ b/.docker/Dockerfile @@ -13,11 +13,28 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ FROM base AS builder +# Note we need leptonica here to build jbig2 RUN apt-get update && apt-get install -y --no-install-recommends \ - python3-pip \ - python3-venv \ + build-essential autoconf automake libtool \ + libleptonica-dev \ + zlib1g-dev \ + libffi-dev \ + ca-certificates \ + curl \ git \ - curl + libcairo2-dev \ + pkg-config + +# Compile and install jbig2 +# Needs libleptonica-dev, zlib1g-dev +RUN \ + mkdir jbig2 \ + && curl -L https://github.com/agl/jbig2enc/archive/c0141bf.tar.gz | \ + tar xz -C jbig2 --strip-components=1 \ + && cd jbig2 \ + && ./autogen.sh && ./configure && make && make install \ + && cd .. \ + && rm -rf jbig2 COPY . /app @@ -32,6 +49,10 @@ RUN /root/.cargo/bin/uv sync --extra test --extra webservice --extra watcher FROM base +RUN apt-get update && apt-get install -y software-properties-common + +RUN add-apt-repository -y ppa:alex-p/tesseract-ocr-devel + RUN apt-get update && apt-get install -y --no-install-recommends \ ghostscript \ fonts-droid-fallback \ @@ -49,6 +70,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ WORKDIR /app +COPY --from=builder /usr/local/lib/ /usr/local/lib/ +COPY --from=builder /usr/local/bin/ /usr/local/bin/ + COPY --from=builder --chown=app:app /app /app ENV PATH="/app/.venv/bin:${PATH}"