@@ -14,6 +14,7 @@ FROM registry.access.redhat.com/ubi9/python-312:latest AS pdf-builder
1414WORKDIR /opt/app-root/bin
1515
1616# OS Packages needs to be installed as root
17+ # hadolint ignore=DL3002
1718USER 0
1819
1920# Copy scripts
@@ -28,8 +29,6 @@ RUN ./install_pandoc.sh
2829# cpu-base #
2930####################
3031FROM ${BASE_IMAGE} AS cpu-base
31- USER 0
32- RUN subscription-manager refresh
3332
3433WORKDIR /opt/app-root/bin
3534
@@ -42,6 +41,14 @@ USER 0
4241COPY --from=ubi-repos /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
4342
4443### BEGIN upgrade first to avoid fixable vulnerabilities
44+ # If we have a Red Hat subscription prepared, refresh it
45+ RUN /bin/bash <<'EOF'
46+ set -Eeuxo pipefail
47+ if command -v subscription-manager &> /dev/null; then
48+ subscription-manager identity &>/dev/null && subscription-manager refresh || echo "Not registered, skipping refresh."
49+ fi
50+ EOF
51+
4552# Problem: The operation would result in removing the following protected packages: systemd
4653# (try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages)
4754# Solution: --best --skip-broken does not work either, so use --nobest
@@ -103,6 +110,8 @@ RUN --mount=type=cache,from=pdf-builder,source=/usr/local/,target=/pdf_builder/,
103110 ./utils/install_pdf_deps.sh; \
104111 fi'
105112
113+ ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH"
114+
106115USER 1001
107116
108117COPY ${MINIMAL_SOURCE_CODE}/pylock.toml ${MINIMAL_SOURCE_CODE}/start-notebook.sh ./
@@ -138,9 +147,3 @@ LABEL name="rhoai/odh-workbench-jupyter-minimal-cpu-py312-rhel9" \
138147 description="Minimal Jupyter CPU notebook image with base Python 3.12 builder image based on UBI9 for ODH notebooks" \
139148 io.k8s.description="Minimal Jupyter CPU notebook image with base Python 3.12 builder image based on UBI9 for ODH notebooks" \
140149 com.redhat.license_terms="https://www.redhat.com/licenses/Red_Hat_Standard_EULA_20191108.pdf"
141-
142- ### BEGIN Dependencies for PDF export
143- RUN ./utils/install_pdf_deps.sh
144- ENV PATH="/usr/local/texlive/bin/linux:/usr/local/pandoc/bin:$PATH"
145-
146- ### END Dependencies for PDF export
0 commit comments