@@ -6,6 +6,24 @@ ARG BASE_IMAGE
66# External image alias for UBI repository configuration
77FROM registry.access.redhat.com/ubi9/ubi AS ubi-repos
88
9+ ############################
10+ # Stage 1: PDF Tool Build #
11+ ############################
12+ FROM registry.access.redhat.com/ubi9/python-312:latest AS pdf-builder
13+
14+ WORKDIR /opt/app-root/bin
15+
16+ # OS Packages needs to be installed as root
17+ USER 0
18+
19+ # Copy scripts
20+ COPY jupyter/utils/install_texlive.sh ./install_texlive.sh
21+ COPY jupyter/utils/install_pandoc.sh ./install_pandoc.sh
22+ RUN chmod +x install_texlive.sh install_pandoc.sh
23+
24+ RUN ./install_texlive.sh
25+ RUN ./install_pandoc.sh
26+
927####################
1028# cpu-base #
1129####################
@@ -71,9 +89,14 @@ COPY ${JUPYTER_REUSABLE_UTILS} utils/
7189USER 0
7290
7391# Dependencies for PDF export begin
74- RUN ./utils/install_pdf_deps.sh
75- ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH"
76- # Dependencies for PDF export end
92+ RUN --mount=type=cache,from=pdf-builder,source=/usr/local/,target=/pdf_builder/,rw \
93+ bash -c ' \
94+ if [[ "$(uname -m)" == "ppc64le" ]]; then \
95+ cp -r /pdf_builder/texlive /usr/local/; \
96+ cp -r /pdf_builder/pandoc /usr/local/; \
97+ else \
98+ ./utils/install_pdf_deps.sh; \
99+ fi'
77100
78101USER 1001
79102
0 commit comments