Skip to content

Commit

Permalink
Reinstate jbig2 building
Browse files Browse the repository at this point in the history
  • Loading branch information
jbarlow83 committed Oct 27, 2024
1 parent 8138664 commit 07f7c6b
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 \
Expand All @@ -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}"
Expand Down

0 comments on commit 07f7c6b

Please sign in to comment.