Skip to content

Commit 10c097f

Browse files
[miniconda] Refactor Dockerfile to sync with anaconda devcontianer (devcontainers#741)
* Rework Dockerfile * Enable tests * Bump `base` image version
1 parent 444888a commit 10c097f

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

src/miniconda/.devcontainer/Dockerfile

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
11
FROM continuumio/miniconda3 as upstream
22

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+
312
# 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+
525
USER root
6-
COPY --from=upstream /opt /opt/
726

27+
# Copy scripts to execute
828
COPY add-notice.sh /tmp/library-scripts/
929

1030
# 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/
3959
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 \
4060
&& rm -rf /tmp/conda-tmp
4161

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-
5162
# [Optional] Uncomment this section to install additional OS packages.
5263
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
5364
# && 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

Comments
 (0)