From 162b6484ff0a77ee4597b407281f76232cd02d47 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Fri, 10 Nov 2023 13:20:18 -0700 Subject: util/docker/jenkins-node: Install pip modules into virtual env Instead of installing the pip modules system-wide, and possibly causing conflicts, install them into a virtual environment for the coreboot user. If we wanted to, in the future, we could install different versions of the modules into different virtual environment directories to allow for testing or anything else we needed. Change-Id: I49c749a13a698bfb7af29bf07e42ac14b67b2ae7 Signed-off-by: Martin Roth Reviewed-on: https://review.coreboot.org/c/coreboot/+/79006 Tested-by: build bot (Jenkins) Reviewed-by: Felix Singer --- util/docker/coreboot-jenkins-node/Dockerfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'util') diff --git a/util/docker/coreboot-jenkins-node/Dockerfile b/util/docker/coreboot-jenkins-node/Dockerfile index ae29e435ede4..2cd8d7881cde 100644 --- a/util/docker/coreboot-jenkins-node/Dockerfile +++ b/util/docker/coreboot-jenkins-node/Dockerfile @@ -31,6 +31,7 @@ RUN apt-get -y update && \ sdcc \ python3-pip \ pykwalify \ + python3-venv \ python3-yaml \ python3-pyelftools \ python3-jsonschema \ @@ -70,10 +71,13 @@ ENTRYPOINT mount /cb-build && \ EXPOSE 49151 USER coreboot -ENV PATH=$PATH:/home/coreboot/.local/bin -RUN echo "export PATH=$PATH:/opt/xgcc/bin" >> /home/coreboot/.bashrc && \ - pip3 install --upgrade --no-cache-dir pip \ - && pip3 install --no-cache-dir \ +ENV VIRTUAL_ENV="/home/coreboot/python3" +ENV PATH=$VIRTUAL_ENV/bin:$PATH:/home/coreboot/.local/bin +RUN echo 'export PATH=$PATH:/opt/xgcc/bin' >> /home/coreboot/.bashrc && \ + echo "source ${VIRTUAL_ENV}/bin/activate" >> /home/coreboot/.bashrc && \ + python3 -m venv /home/coreboot/python3 && \ + pip3 install --upgrade --no-cache-dir pip && \ + pip3 install --no-cache-dir \ setuptools==58.2.0 \ jinja2==3.1.2 \ recommonmark===0.7.1 \ -- cgit v1.2.3