![如何設定 UBI8 容器透過 sphinx 編譯 PDF 文件?](https://rvso.com/image/168795/%E5%A6%82%E4%BD%95%E8%A8%AD%E5%AE%9A%20UBI8%20%E5%AE%B9%E5%99%A8%E9%80%8F%E9%81%8E%20sphinx%20%E7%B7%A8%E8%AD%AF%20PDF%20%E6%96%87%E4%BB%B6%EF%BC%9F.png)
我看到有一個基於 Debian 的映像可以在這裡執行此操作(https://hub.docker.com/r/sphinxdoc/sphinx-latexpdf),但我需要將我的解決方案基於 Red Hat UBI 8 容器映像。我需要安裝哪些軟體包才能使其在該平台上運行? (建置時我將使用 RHEL 訂閱的計算機。)
我希望以重組文字格式裝載包含我的文件的捲,並希望容器透過 Sphinx 提供 HTML 和 PDF 輸出,就像連結的 sphinxdoc/sphinx-latexpdf 文件一樣。
答案1
各種要求似乎分佈在 CodeReady、AppStream 和 Epel 儲存庫中。您需要設定所有這些,然後似乎texlive-*
需要安裝幾乎每個軟體包。我將這些清單放入 texlive-requirements.txt 中。然後我創建了這個 Dockerfile 並建置了它。我還假設您需要將一些 python 要求放入 pip-requirements.txt 中。
FROM ubi8
WORKDIR /docs
# Setup Extra RPM repositories
# CodeReady Builder is an EPEL dependency and has several texlive-* packages
# Epel is a dependency of latexmk
RUN yum -y update \
&& yum -y install yum-utils \
&& yum-config-manager --enable codeready-builder-for-rhel-8-x86_64-rpms \
&& rpm --import http://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-8 \
&& yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
# Fill texlive-requirements.txt with all the packages in
# `yum list available|grep texlive` as run from a UBI8 container with
# the above repos provided
ARG deps="ImageMagick graphviz make wget enchant curl python3-pip latexmk"
ADD texlive-requirements.txt /tmp/yum.txt
RUN yum install -y $deps $(cat /tmp/yum.txt) && \
yum clean all
# For whatever python dependencies, put them in pip-requirements.txt
ADD pip-requirements.txt /tmp/requirements.txt
RUN pip3 install -r /tmp/requirements.txt
這應該像sphinx 提供的 docker hub 上的映像包括磁碟區安裝並支援 HTML 和 LatexPDF 建置。