Skip to content

Instantly share code, notes, and snippets.

@crazy4pi314
Created December 6, 2022 20:48
Show Gist options
  • Save crazy4pi314/204b58faa02cae60cbb71623d481d7cc to your computer and use it in GitHub Desktop.
Save crazy4pi314/204b58faa02cae60cbb71623d481d7cc to your computer and use it in GitHub Desktop.
Fast mamba containers
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/anaconda
{
"name": "Fast mamba",
"build": {
"context": "..",
"dockerfile": "Dockerfile"
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
//"postCreateCommand": "conda init",
// Configure tool-specific properties. Feel free to remove whatever you don't need.
"customizations": {
"vscode": {
"settings": {
"python.defaultInterpreterPath": "/opt/conda/bin/python"
},
"extensions": [
"GitHub.codespaces",
"streetsidesoftware.code-spell-checker",
"ms-vscode-remote.remote-containers",
"GitHub.copilot",
"GitHub.vscode-pull-request-github",
"ms-toolsai.jupyter",
"DavidAnson.vscode-markdownlint",
"donjayamanne.python-environment-manager",
"ms-vscode-remote.vscode-remote-extensionpack",
"donjayamanne.python-extension-pack"
]
}
}
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
FROM mcr.microsoft.com/devcontainers/miniconda:latest
# Copy environment.yml (if found) to a temp location so we update the environment. Also
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
RUN conda install -n base -c conda-forge mamba
COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bin/mamba env update -n base -f /tmp/conda-tmp/environment.yml; fi \
&& rm -rf /tmp/conda-tmp
# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
This file copied into the container along with environment.yml* from the parent
folder. This file is included to prevents the Dockerfile COPY instruction from
failing if no environment.yml is found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment