This is an example project which uses micromamba-devcontainer. The .devcontainer
folder was created using Cruft with cookiecutter-micromamba-devcontainer.
- This project's GitHub repository
- The micromamba-devcontainer base Docker image
- The cookiecutter-micromamba-devcontainer template for the
.devcontainer
folder - Cruft for creating and updating projects from Cookiecutter templates
-
Install Cruft (also manages updates) or Cookiecutter.
-
Create
.devcontainer
in the project root by running the commandcruft create https://github.com/maresb/cookiecutter-micromamba-devcontainer
or
cookiecutter https://github.com/maresb/cookiecutter-micromamba-devcontainer
You will be asked values for the following variables, which are stored in
.devcontainer/.cruft.json
:package_name
: The name of the main package of your project, as you wouldimport
it from Python.timezone
: The timezone to configure in the devcontainer.packages_dir
: The directory wherepackage_name
is located (oftensrc
), or.
for the project root.
-
The project root should contain the subdirectory
[packages_dir]/[package_name]
, and moreover this subdirectory should contain an__init__.py
file. -
Customize
.devcontainer/dev-conda-environment.yaml
with your desired Conda development packages. -
Customize
.devcontainer/dev.Dockerfile
to install (a skeleton of) your project, preferrably in editable mode (e.g.pip install -e .
). This way the project dependencies will be installed in the devcontainer. -
Customize the
extensions
andsettings
in.devcontainer/devcontainer.json
. -
Press Ctrl+Shift+P and select "Remote-Containers: Rebuild and Reopen in Container", and if all goes well, this will load successfully.
For more information, see micromamba-devcontainer.