|
1 | 1 | FROM continuumio/miniconda3 as upstream |
2 | 2 |
|
| 3 | +# Temporary: Upgrade python packages due to mentioned CVEs |
| 4 | +# They are installed by the base image (continuumio/miniconda3) which does not have the patch. |
| 5 | +RUN conda install \ |
| 6 | + # https://github.com/pyca/cryptography/security/advisories/GHSA-5cpq-8wj7-hf2v |
| 7 | + pyopenssl=23.2.0 \ |
| 8 | + cryptography=41.0.2 \ |
| 9 | + # https://github.com/advisories/GHSA-j8r2-6x86-q33q |
| 10 | + requests=2.31.0 |
| 11 | + |
3 | 12 | # Reset and copy updated files with updated privs to keep image size down |
4 | | -FROM mcr.microsoft.com/devcontainers/base:0-bullseye |
| 13 | +FROM mcr.microsoft.com/devcontainers/base:1-bullseye |
| 14 | + |
| 15 | +ARG USERNAME=vscode |
| 16 | + |
| 17 | +# Create the conda group and add remote user to the group |
| 18 | +RUN groupadd -r conda --gid 900 \ |
| 19 | + && usermod -aG conda ${USERNAME} |
| 20 | + |
| 21 | +# Copy opt folder, set ownership and group permissions |
| 22 | +COPY --chown=:conda --chmod=775 --from=upstream /opt/conda /opt/conda |
| 23 | +RUN chmod =2775 /opt/conda |
| 24 | + |
5 | 25 | USER root |
6 | | -COPY --from=upstream /opt /opt/ |
7 | 26 |
|
| 27 | +# Copy scripts to execute |
8 | 28 | COPY add-notice.sh /tmp/library-scripts/ |
9 | 29 |
|
10 | 30 | # Setup conda to mirror contents from https://github.com/ContinuumIO/docker-images/blob/master/miniconda3/debian/Dockerfile |
@@ -39,25 +59,6 @@ COPY environment.yml* noop.txt /tmp/conda-tmp/ |
39 | 59 | RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \ |
40 | 60 | && rm -rf /tmp/conda-tmp |
41 | 61 |
|
42 | | -# Temporary: Upgrade python packages due to mentioned CVEs |
43 | | -# They are installed by the base image (continuumio/miniconda3) which does not have the patch. |
44 | | -RUN conda install \ |
45 | | - # https://github.com/pyca/cryptography/security/advisories/GHSA-5cpq-8wj7-hf2v |
46 | | - pyopenssl=23.2.0 \ |
47 | | - cryptography=41.0.2 \ |
48 | | - # https://github.com/advisories/GHSA-j8r2-6x86-q33q |
49 | | - requests=2.31.0 |
50 | | - |
51 | 62 | # [Optional] Uncomment this section to install additional OS packages. |
52 | 63 | # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ |
53 | 64 | # && apt-get -y install --no-install-recommends <your-package-list-here> |
54 | | - |
55 | | -# Create conda group, update conda directory permissions, |
56 | | -# add user to conda group |
57 | | -# Note: We need to execute these commands after pip install / conda update |
58 | | -# since pip doesn't preserve directory permissions |
59 | | -RUN groupadd -r conda --gid 900 \ |
60 | | - && chown -R :conda /opt/conda \ |
61 | | - && chmod -R g+w /opt/conda \ |
62 | | - && find /opt -type d | xargs -n 1 chmod g+s \ |
63 | | - && usermod -aG conda ${USERNAME} |
|
0 commit comments