@@ -9,6 +9,12 @@ ARG PIP3=pip3_docs.sh
ENV TEXTOOLDIR=/opt/docs-build-tex-tools
ENV PATH="$PATH:$TEXTOOLDIR/tl/bin/x86_64-linux"
+# RUN . /tmp/yocto-venv/bin/activate doesn't work because env variables set in
+# RUN don't persist, so set up the virtualenv manually.
+# Unsetting env variables in Containerfile is difficult, so we hope it works
+# fine without doing that for PYTHONHOME (see activate script content).
+ENV VIRTUAL_ENV=/tmp/yocto-venv
+ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# relative to the location of the dockerfile
COPY --chmod=777 ${ESSENTIAL} /temp/host_packages_essential.sh
@@ -13,6 +13,13 @@ COPY --chmod=777 ${DOCS} /temp/host_packages_docs.sh
COPY --chmod=777 ${DOCS_PDF} /temp/host_packages_docs_pdf.sh
COPY --chmod=777 ${PIP3} /temp/pip3_docs.sh
+# RUN . /tmp/yocto-venv/bin/activate doesn't work because env variables set in
+# RUN don't persist, so set up the virtualenv manually.
+# Unsetting env variables in Containerfile is difficult, so we hope it works
+# fine without doing that for PYTHONHOME (see activate script content).
+ENV VIRTUAL_ENV=/tmp/yocto-venv
+ENV PATH="$VIRTUAL_ENV/bin:$PATH"
+
# Zypper doesn't have environment variables to specify whether to run in
# non-interactive mode like Debian does with DEBIAN_FRONTEND and piping yes to
# the scripts doesn't need to be enough as well, so let's force all zypper calls
@@ -1 +1,3 @@
-sudo pip3 install sphinx sphinx_rtd_theme pyyaml sphinx-copybutton
+python3 -m venv --clear --system-site-packages /tmp/yocto-venv
+. /tmp/yocto-venv/bin/activate
+python3 -m pip install sphinx sphinx_rtd_theme pyyaml sphinx-copybutton