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
.devcontainerfolder - Cruft for creating and updating projects from Cookiecutter templates
-
Install Cruft (also manages updates) or Cookiecutter.
-
Create
.devcontainerin 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 wouldimportit from Python.timezone: The timezone to configure in the devcontainer.packages_dir: The directory wherepackage_nameis 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__.pyfile. -
Customize
.devcontainer/dev-conda-environment.yamlwith your desired Conda development packages. -
Customize
.devcontainer/dev.Dockerfileto 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
extensionsandsettingsin.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.