Skip to content

Commit 95ce158

Browse files
committed
Switch to mamba devcontainer to fix issue with conda ignoring versions
1 parent da780df commit 95ce158

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

.devcontainer/Dockerfile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
ARG VARIANT=2
2-
FROM mcr.microsoft.com/devcontainers/universal:${VARIANT}
1+
# https://github.com/microsoft/vscode-dev-containers/blob/main/containers/python-3-miniconda/.devcontainer/base.Dockerfile
2+
ARG VARIANT=3
3+
FROM mcr.microsoft.com/vscode/devcontainers/miniconda:${VARIANT}
4+
5+
# Install mamba for faster install
6+
ENV MAMBA_EXE="/opt/mambaforge/bin/mamba"
7+
RUN cd /tmp \
8+
&& curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-$(uname)-$(uname -m).sh" \
9+
&& sudo bash Mambaforge-$(uname)-$(uname -m).sh -b -p /opt/mambaforge
310

411
# Create the conda environment
512
COPY environment.yml /tmp/conda-tmp/
6-
RUN conda env create --file /tmp/conda-tmp/environment.yml
13+
RUN $MAMBA_EXE env create --file /tmp/conda-tmp/environment.yml --prefix /home/vscode/.conda/envs/pandas_workshop \
14+
&& $MAMBA_EXE init
715

816
# Update PATH for Jupyter editing option
9-
ENV PATH="/opt/conda/envs/pandas_workshop/bin:${PATH}"
17+
ENV PATH="/home/vscode/.conda/envs/pandas_workshop/bin:${PATH}"
18+
ENV PROJ_LIB="/home/vscode/.conda/envs/pandas_workshop/share/proj"

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"vscode": {
2727
// Set *default* container specific settings.json values on container create.
2828
"settings": {
29-
"python.defaultInterpreterPath": "/opt/conda/envs/pandas_workshop"
29+
"python.defaultInterpreterPath": "/home/vscode/.conda/envs/pandas_workshop"
3030
},
3131

3232
// Add the IDs of extensions you want installed when the container is created.

0 commit comments

Comments
 (0)