11# Base ##################################################################
2- FROM haskell:9.12-slim-bookworm AS builder-base
2+ FROM docker.io/ haskell:9.12-slim-bookworm AS builder-base
33
44ENV DEBIAN_FRONTEND=noninteractive
55RUN apt-get -q --no-allow-insecure-repositories update && \
@@ -23,20 +23,14 @@ RUN git clone --branch=3.8.2.1 --depth=1 --quiet \
2323 https://github.com/jgm/pandoc /app
2424
2525# Install Haskell dependencies
26- # Add pandoc-crossref to project
27- RUN printf "extra-packages: pandoc-crossref\n " > cabal.project.local;
28-
29- # Build pandoc and pandoc-crossref. The `allow-newer` is required for
30- # when pandoc-crossref has not been updated yet, but we want to build
31- # anyway.
26+ # Build pandoc CLI binary.
3227RUN cabal build \
3328 --jobs \
3429 --disable-tests \
3530 --disable-bench \
3631 --enable-split-sections \
3732 --enable-executable-stripping \
3833 --upgrade-dependencies \
39- --allow-newer='pandoc-crossref:pandoc' \
4034 --ghc-options='-O1 -optc-Os -optl=-pthread -fPIC -j' \
4135 --ghc-options='+RTS -M4G -A128m -n2m -RTS' \
4236 --constraint='any.Cabal ==3.14.1.0' \
@@ -376,11 +370,11 @@ RUN cabal build \
376370 --constraint='zip-archive -executable' \
377371 --constraint='any.zlib ==0.7.1.1' \
378372 --constraint='zlib -bundled-c-zlib +non-blocking-ffi +pkg-config' \
379- . pandoc-cli pandoc-crossref
373+ . pandoc-cli
380374
381375# Cabal's exec stripping doesn't seem to work reliably, let's do it here.
382376RUN find dist-newstyle \
383- -name 'pandoc* ' -type f -perm -u+x \
377+ -name 'pandoc' -type f -perm -u+x \
384378 -exec strip '{}' ';' \
385379 -exec cp '{}' /usr/local/bin/ ';'
386380
@@ -419,17 +413,3 @@ RUN ln -s /usr/local/bin/pandoc /usr/local/bin/pandoc-lua \
419413 && rm -rf /var/lib/apt/lists/* \
420414# Create user data directory
421415 && mkdir -p "$XDG_DATA_HOME" /pandoc
422-
423- # Core ##################################################################
424- FROM minimal AS core
425- COPY --from=builder \
426- /usr/local/bin/pandoc-crossref \
427- /usr/local/bin/
428-
429- # Additional packages frequently used during conversions
430- # NOTE: `libsrvg`, pandoc uses `rsvg-convert` for working with svg images.
431- RUN apt-get -q --no-allow-insecure-repositories update \
432- && DEBIAN_FRONTEND=noninteractive \
433- apt-get install --assume-yes --no-install-recommends \
434- librsvg2-bin=2.* \
435- && rm -rf /var/lib/apt/lists/*
0 commit comments