Skip to content

Commit

Permalink
Add minimal dev container configuration
Browse files Browse the repository at this point in the history
We would probably want something more fully featured than this, but this
is a start with VSCode's configuration tool, and some manually added
extensions.

For more, we could use a Dockerfile or Docker Compose file that we
provide.
  • Loading branch information
StevenMaude committed Jun 29, 2023
1 parent 6f5d388 commit af3e3a3
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
// 2023-06-29: Use bullseye image instead of bookworm.
// At time of writing, bookworm is new and may have issues with dev containers:
// https://github.com/devcontainers/features/issues/576
"image": "mcr.microsoft.com/devcontainers/python:3.11-bullseye",

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
// TODO: Not sure if we would be better installing tools via requirements.txt.
"ghcr.io/devcontainers/features/python:1": {
"installTools": true,
"installJupyterlab": true,
// https://github.com/devcontainers/features/issues/598#issuecomment-1612216163
"version": "none"
},
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"moby": true,
"azureDnsAutoDetection": true,
"installDockerBuildx": true,
"version": "latest",
"dockerDashComposeVersion": "v2"
}
},

// 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": "pip3 install --user -r requirements.txt",

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-toolsai.jupyter",
"ms-toolsai.jupyter-renderers"
]
}
}

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}

0 comments on commit af3e3a3

Please sign in to comment.