Dev Containers
This guide shows you how to work with Dev Containers using Docker and VS Code. This lab demonstrates the key concepts and components of Dev Containers through a simple Python application.
Prerequisites
Section titled “Prerequisites”- Docker installed and running.
- Dev Containers extension installed.
How to execute
Section titled “How to execute”-
Open in Dev Container: Open VS Code in the project folder and execute this command in the Command Palette:
Terminal window > Dev Containers: Reopen in Container -
Run the Example:
Terminal window python main.py
Troubleshooting
Section titled “Troubleshooting”| Issue | Solution |
|---|---|
| Container won’t start | Ensure Docker is running. Rebuild via Dev Containers: Rebuild Container from the Command Palette. |
| Dependencies not installing | Run manually inside the container: pip3 install uv && uv sync |
| Extension not working | Verify the extension ID in devcontainer.json. Rebuild the container. |