Prerequisites:
- Docker installed locally
- VS Code instaleld locally
Use this lightweight template to start a python project within a development container. Viewing in GitHub, select Use this template if creating a new repository.
To run this in the cloud (on a throw-away virtual machine provided by GitHub) you can run it in GitHub Codespaces in 1 click. Then you'll be up and running with VS Code in the browser.
To run this locally you will need Docker & VS Code. Open the repo in VS Code & a pop up will appear to ask you if you want to reopen in a dev container & it will spin up the container for you automatically (so no need to worry about setting docker containers up for each person). See below for more in-depth Development Containers documentation.
Bundled with:
Python 3.9-bullseye(-bullseyevariants on local on arm64/Apple Silicon)Node LTS
A development container is a running Docker container with a well-defined tool/runtime stack and its prerequisites. You can try out development containers with GitHub Codespaces or Visual Studio Code Remote - Containers.
This is a sample project that lets you try out either option in a few easy steps. We have a variety of other vscode-remote-try-* sample projects, too.
Follow these steps to open this sample in a Codespace:
- Click the Code drop-down menu and select the Open with Codespaces option.
- Select + New codespace at the bottom on the pane.
For more information on creating your codespace, visit the GitHub documentation.
If you already have VS Code and Docker installed, you can click the badge above or here to get started. Clicking these links will cause VS Code to automatically install the Remote - Containers extension if needed, clone the source code into a container volume, and spin up a dev container for use.
Follow these steps to open this sample in a container using the VS Code Remote - Containers extension:
-
If this is your first time using a development container, please ensure your system meets the prerequisites (i.e. have Docker installed) in the getting started steps.
-
To use this repository, you can either open the repository in an isolated Docker volume:
- Press F1 and select the Remote-Containers: Try a Sample... command.
- Choose the "Python" sample, wait for the container to start, and try things out!
Note: Under the hood, this will use the Remote-Containers: Clone Repository in Container Volume... command to clone the source code in a Docker volume instead of the local filesystem. Volumes are the preferred mechanism for persisting container data.
Or open a locally cloned copy of the code:
- Clone this repository to your local filesystem.
- Press F1 and select the Remote-Containers: Open Folder in Container... command.
- Select the cloned copy of this folder, wait for the container to start, and try things out!
Rebuild or update your container
You may want to make changes to your container, such as installing a different version of a software or forwarding a new port. You'll rebuild your container for your changes to take effect.
- Press F1 and select the Remote-Containers: Rebuild Container or Codespaces: Rebuild Container command so the modifications are picked up.
See license.