From 8064aac856fc04610ec95f7225f96f26c8c8bf47 Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Thu, 28 Dec 2023 11:07:17 -0800 Subject: [PATCH 1/3] Explicitly set VIRTUAL_ENV related env vars Can be removed once https://github.com/rocker-org/rocker-versioned2/pull/740 is merged --- Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Dockerfile b/Dockerfile index 0f43c4e..fc6da30 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,10 @@ FROM rocker/binder:4.3.2 +# Needed until https://github.com/rocker-org/rocker-versioned2/pull/740 is +# merged +ENV VIRTUAL_ENV=/opt/venv +ENV PATH=${VIRTUAL_ENV}/bin:${PATH} + COPY requirements.txt /tmp/requirements.txt RUN pip install --no-cache -r /tmp/requirements.txt From 0cefb96567fcd66ac2e0c32ee8846371a5e5710e Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Thu, 28 Dec 2023 12:53:04 -0800 Subject: [PATCH 2/3] Figure out what our uid is --- Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Dockerfile b/Dockerfile index fc6da30..d35246e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,8 @@ FROM rocker/binder:4.3.2 ENV VIRTUAL_ENV=/opt/venv ENV PATH=${VIRTUAL_ENV}/bin:${PATH} +RUN id && ls -la ${VIRTUAL_ENV} + COPY requirements.txt /tmp/requirements.txt RUN pip install --no-cache -r /tmp/requirements.txt From 75946611956069fd6cdebe6a9e60bcd313a14ac4 Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Thu, 28 Dec 2023 22:32:49 -0800 Subject: [PATCH 3/3] Install python packages as root Non-root package installation still does not actually work --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d35246e..242c200 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,11 +5,13 @@ FROM rocker/binder:4.3.2 ENV VIRTUAL_ENV=/opt/venv ENV PATH=${VIRTUAL_ENV}/bin:${PATH} -RUN id && ls -la ${VIRTUAL_ENV} +USER root COPY requirements.txt /tmp/requirements.txt RUN pip install --no-cache -r /tmp/requirements.txt +USER ${NB_USER} + # Install learnr and other requested packages in https://2i2c.freshdesk.com/a/tickets/741 # mosaic installed per https://2i2c.freshdesk.com/a/tickets/973 RUN install2.r --skipinstalled \