From 675338bea944e72cbb36735ca4848f92cf9c8988 Mon Sep 17 00:00:00 2001 From: Jan David Mol <mol@astron.nl> Date: Tue, 28 Sep 2021 12:58:48 +0200 Subject: [PATCH] L2SS-394: Add pyvisa for hardware debugging, install pyppeteer last to switch to CONTAINER_EXECUTION_UID at the end, as sudo may not work after that. --- docker-compose/jupyter/Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-compose/jupyter/Dockerfile b/docker-compose/jupyter/Dockerfile index 29f736cdc..0ad27d2a5 100644 --- a/docker-compose/jupyter/Dockerfile +++ b/docker-compose/jupyter/Dockerfile @@ -9,7 +9,6 @@ ARG CONTAINER_EXECUTION_UID=1000 ENV HOME=/home/user RUN sudo mkdir -p ${HOME} RUN sudo chown ${CONTAINER_EXECUTION_UID} -R ${HOME} -USER ${CONTAINER_EXECUTION_UID} RUN sudo pip3 install jupyter RUN sudo pip3 install ipykernel @@ -20,8 +19,6 @@ RUN sudo pip3 install matplotlib jupyterplot # Allow Download as -> PDF via html RUN sudo pip3 install nbconvert RUN sudo pip3 install notebook-as-pdf -# pyppeteer-install installs in the homedir, so run it as the user that will execute the notebook -RUN pyppeteer-install # see https://github.com/jupyter/nbconvert/issues/1434 RUN sudo bash -c "echo DEFAULT_ARGS += [\\\"--no-sandbox\\\"] >> /usr/local/lib/python3.7/dist-packages/pyppeteer/launcher.py" @@ -46,7 +43,7 @@ RUN sudo pip3 install python-logstash-async COPY jupyter-notebook /usr/local/bin/jupyter-notebook #Install further python modules -RUN sudo pip3 install PyMySQL[rsa] sqlalchemy +RUN sudo pip3 install PyMySQL[rsa] sqlalchemy pyvisa # Add Tini. Tini operates as a process subreaper for jupyter. This prevents kernel crashes. ENV TINI_VERSION v0.6.0 @@ -54,3 +51,6 @@ ENV JUPYTER_RUNTIME_DIR=/tmp ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini RUN sudo chmod +x /usr/bin/tini +USER ${CONTAINER_EXECUTION_UID} +# pyppeteer-install installs in the homedir, so run it as the user that will execute the notebook +RUN pyppeteer-install -- GitLab