@@ -3,12 +3,6 @@ FROM continuumio/anaconda3 as upstream
33# Verify OS version is expected one
44RUN . /etc/os-release && if [ "${VERSION_CODENAME}" != "bullseye" ]; then exit 1; fi
55
6- # Update, change owner
7- RUN groupadd -r conda --gid 900 \
8- && chown -R :conda /opt/conda \
9- && chmod -R g+w /opt/conda \
10- && find /opt -type d | xargs -n 1 chmod g+s
11-
126# Reset and copy updated files with updated privs to keep image size down
137FROM mcr.microsoft.com/devcontainers/base:0-bullseye
148COPY --from=upstream /opt /opt/
@@ -47,8 +41,6 @@ RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
4741 && ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh \
4842 && echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc \
4943 && echo "conda activate base" >> ~/.bashrc \
50- && groupadd -r conda --gid 900 \
51- && usermod -aG conda ${USERNAME} \
5244 && apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/library-scripts/add-notice.sh
5345
5446# Temporary: Upgrade python packages due to mentioned CVEs
@@ -58,26 +50,16 @@ RUN python3 -m pip install \
5850 --upgrade joblib \
5951 # https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-24065
6052 cookiecutter \
61- # https://github.com/advisories/GHSA-39hc-v87j-747x
62- cryptography \
6353 # https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-34749
6454 mistune \
6555 # https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-34141
6656 numpy \
67- # https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-23491
68- certifi \
69- # https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-40897
70- setuptools \
71- # https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-40899
72- future \
73- # https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-40898
74- wheel \
75- # https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32862
76- nbconvert \
7757 # https://github.com/devcontainers/images/issues/486
7858 pyOpenssl \
7959 # https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-25577
80- werkzeug
60+ werkzeug \
61+ # https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-32862
62+ nbconvert
8163
8264# Copy environment.yml (if found) to a temp location so we can update the environment. Also
8365# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
@@ -89,3 +71,13 @@ RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bi
8971# [Optional] Uncomment this section to install additional OS packages.
9072# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
9173# && apt-get -y install --no-install-recommends <your-package-list-here>
74+
75+ # Create conda group, update conda directory permissions,
76+ # add user to conda group
77+ # Note: We need to execute these commands after pip install / conda update
78+ # since pip doesn't preserve directory permissions
79+ RUN groupadd -r conda --gid 900 \
80+ && chown -R :conda /opt/conda \
81+ && chmod -R g+w /opt/conda \
82+ && find /opt -type d | xargs -n 1 chmod g+s \
83+ && usermod -aG conda ${USERNAME}
0 commit comments