🌐
Visual Studio Code
code.visualstudio.com β€Ί docs β€Ί devcontainers β€Ί create-dev-container
Create a Dev Container
November 3, 2021 - Python & PostgreSQL - A Python container that connects to PostgreSQL in a different container. Docker-Outside-of-Docker Compose - Includes the Docker CLI and illustrates how you can use it to access your local Docker install from inside a dev ...
🌐
GitHub
github.com β€Ί microsoft β€Ί vscode-dev-containers β€Ί blob β€Ί main β€Ί containers β€Ί python-3 β€Ί .devcontainer β€Ί devcontainer.json
vscode-dev-containers/containers/python-3/.devcontainer/devcontainer.json at main Β· microsoft/vscode-dev-containers
November 30, 2023 - // Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6 Β· // Append -bullseye or -buster to pin to an OS version. // Use -bullseye variants on local on arm64/Apple Silicon. "VARIANT": "3.10-bullseye", // Options Β· "NODE_VERSION": "lts/*" } }, Β· // Configure tool-specific properties. "customizations": { // Configure properties specific to VS Code. "vscode": { // Set *default* container specific settings.json values on container create.
Author Β  microsoft
Discussions

python - devcontainer.json for VScode using existing Container - Stack Overflow
How to use existing container in VSCode? I have a file called .devcontainer.json. The path is /home/myname/Documents/ABC/.devcontainer. { "name": "Kaggle Dev CPU", "... More on stackoverflow.com
🌐 stackoverflow.com
docker - VSCode remote-container default python interpreter - Stack Overflow
I then open a python file and hit ... 64-bit"(/usr/bin/python3) to "3.10.4 ('base':conda)" (/opt/conda/bin/python). Is there a way to avoid this last step? Perhaps adding something to the devcontainer.json file?... More on stackoverflow.com
🌐 stackoverflow.com
Python Devcontainer Setup for VSCode
You don't really need a separate virtualenv if you're using a container. More on reddit.com
🌐 r/vscode
2
1
September 28, 2023
How fix Python import error in VS Code editor when using a Dev Container? - Stack Overflow
I've opened a project with the following structure in VS Code (1.71.0 on macOS, Intel) and activated a Dev Container (I've tried the default Python 3.9 and 3.10 containers from Microsoft, with and without using python3 -m venv ...): project/ .devcontainer/ devcontainer.json Dockerfile foo/ ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
GitHub
github.com β€Ί microsoft β€Ί vscode-remote-try-python
GitHub - microsoft/vscode-remote-try-python: Python sample project for trying out Dev Containers Β· GitHub
Notice that the Python extension is already installed in the container since the .devcontainer/devcontainer.json lists "ms-python.python" as an extension to install automatically when the container is created.
Starred by 919 users
Forked by 1.8K users
Languages Β  Python 73.7% | HTML 26.3%
🌐
GitHub
github.com β€Ί devcontainers β€Ί features β€Ί blob β€Ί main β€Ί src β€Ί python β€Ί devcontainer-feature.json
features/src/python/devcontainer-feature.json at main Β· devcontainers/features
"text": "This dev container includes `python3` and `pip3` pre-installed and available on the `PATH`, along with the Python language extensions for Python development."
Author Β  devcontainers
🌐
Xebia
xebia.com β€Ί home β€Ί blog β€Ί how to create a devcontainer for your python project
How To Create A Devcontainer For Your Python Project | Xebia
November 21, 2022 - What files are required to create a devcontainer for a Python project? A typical setup includes a .devcontainer/devcontainer.json configuration file and optionally a Dockerfile. These define the runtime, dependencies, and tools required for the development environment.
🌐
Docker Hub
hub.docker.com β€Ί r β€Ί microsoft β€Ί devcontainers-python
microsoft/devcontainers-python - Docker Image
Develop Python 3 applications. See history⁠ for information on the contents of published images. You can directly reference pre-built versions of Dockerfile by using the image property in .devcontainer/devcontainer.json or updating the FROM statement in your own Dockerfile with one of the ...
🌐
Medium
andypickup.com β€Ί developing-in-python-with-dev-containers-part-1-setup-f1aeb89cbfed
Developing in Python with Dev Containers β€” Part 1: Setup | by Andy Pickup | Medium
April 15, 2024 - VSCode Command Palette β€” select Python container image Β· This will create a .devcontainer folder with a devcontainer.json file inside. This json file is super basic and just gives the container a name and the path to the container image.
Find elsewhere
🌐
Medium
medium.com β€Ί data-science β€Ί setting-a-dockerized-python-environment-the-elegant-way-f716ef85571d
Setting A Dockerized Python Environment β€” The Elegant Way | by Rami Krispin | TDS Archive | Medium
April 6, 2024 - In the next section, we will start ... Python image (python:3.10). The below devcontainer.json file provides a simple example for setting up a Python environment....
🌐
Stack Overflow
stackoverflow.com β€Ί questions β€Ί 73520003 β€Ί devcontainer-json-for-vscode-using-existing-container
python - devcontainer.json for VScode using existing Container - Stack Overflow
I have a file called .devcontainer.json. The path is /home/myname/Documents/ABC/.devcontainer. { "name": "Kaggle Dev CPU", "image": "gcr.io/kaggle-images/python:v100", "extensions": [ "ms-python.python", ], "settings": { "terminal.integrated.shell.linux": "/bin/bash", "python.pythonPath": "/opt/conda/bin/python" }, "devPort": 8888, "shutdownAction": "none" }
🌐
Medium
medium.com β€Ί @dexterwilliams04 β€Ί getting-started-with-python-3-dev-containers-4f14821fec6b
Getting Started with Python 3 Dev Containers | by Dexter Williams | Medium
October 1, 2020 - The code snippet below shows a list of Python folder projects that come directly from the VS Code dev container gallery repo: $ tree vs-code-dev-containers vs-code-dev-containers β”œβ”€β”€ containers β”‚ β”œβ”€β”€ dotnetcore β”‚ β”‚ └── devcontainer.json # dev container definition β”‚ β”œβ”€β”€ python-3-anaconda β”‚ β”‚ └── devcontainer.json # dev container definition β”‚ ── python-3-device-simulator-express β”‚ β”‚ └── devcontainer.json # dev container definition β”‚ β”œβ”€β”€ python-3-miniconda β”‚ β”‚ └── devcontainer.json # dev container definition β”‚ β”œβ”€β”€ python-3-postgres β”‚ β”‚ └── devcontainer.json # dev container definition β”‚ β”œβ”€β”€ python-3 β”‚ β”‚ └── devcontainer.json # dev container definition β”‚ β”œβ”€β”€ ...
🌐
Towards Data Science
towardsdatascience.com β€Ί home β€Ί latest β€Ί setting a dockerized python environment – the elegant way
Setting A Dockerized Python Environment - The Elegant Way | Towards Data Science
January 21, 2025 - In the next section, we will start ... Python image (python:3.10). The below devcontainer.json file provides a simple example for setting up a Python environment....
🌐
GitHub
github.com β€Ί microsoft β€Ί vscode-dev-containers β€Ί blob β€Ί main β€Ί containers β€Ί python-3 β€Ί README.md
vscode-dev-containers/containers/python-3/README.md at main Β· microsoft/vscode-dev-containers
While the definition itself works unmodified, you can select the version of Python the container uses by updating the VARIANT arg in the included devcontainer.json (and rebuilding if you've already created the container).
Author Β  microsoft
🌐
Tigrisdata
tigrisdata.com β€Ί blog β€Ί dev-containers-python
Standardizing Python Environments with Development Containers | Tigris Object Storage
July 3, 2025 - This could be anything from copying your source code into the image, building that code, installing dependencies, or anything else that boils down to copying files and running commands. When you define a development container, you make a devcontainer.json manifest that specifies the base image you’re working from and any features you want to add to it.
🌐
Medium
medium.com β€Ί marvelous-mlops β€Ί how-to-start-with-dev-containers-1e92bf0e0f78
How to start with Dev Containers. Using a virtual environment to isolate… | by Başak Tuğçe Eskili | Marvelous MLOps | Medium
January 3, 2024 - All container configuration is stored in a standard devcontainer.json file in the .devcontainer folder. This packages instructions for your environment. You can start with any base image of a specific language, generate a new development environment, and start developing with it. Let’s create a new development container for a Python project from a base image.
🌐
GitHub
github.com β€Ί python β€Ί cpython β€Ί blob β€Ί main β€Ί .devcontainer β€Ί devcontainer.json
cpython/.devcontainer/devcontainer.json at main Β· python/cpython
"image": "ghcr.io/python/devcontainer:latest", "onCreateCommand": [ // Install common tooling. "dnf", "install", "-y", // For umask fix below. "/usr/bin/setfacl" ], "updateContentCommand": { // Using the shell for `nproc` usage.
Author Β  python
🌐
Reddit
reddit.com β€Ί r/vscode β€Ί python devcontainer setup for vscode
r/vscode on Reddit: Python Devcontainer Setup for VSCode
September 28, 2023 -

I'm starting to look into devcontainers with VSCode and I am looking for a container configuration (Dockerfile/devcontainer.json) that sets up a good Python development environment with some recommended extensions and settings (e.g. paths, venv, fromatting, linting) for beginners (its been some time since I was doing Python development), but that's not over-complicated.

I have the following resources that I have pieced together as a starting point and could use some input and feedback on these (I'm not sure if everything makes sense) and what to improve for a good development experience. Particularly I'm looking for input on the VSCode extensions / settings.

docker-compose.dev.yaml

version: '3.9'

networks: app-dev-network: 
    driver: bridge 
    name: app-dev-network

services:

backend:

    image: backend-dev-image
    container_name: backend-dev-container
    build:
        context: ./
        dockerfile: ./Dockerfile.dev
    volumes:
        - ..:/workspace:cache
    networks:
        - app-dev-network
    ports:
        - target: 5000 
          published: 5000

    command: sleep infinity

Dockerfile.dev

ARG VARIANT="3.11-bookworm" 
FROM mcr.microsoft.com/devcontainers/python:${VARIANT}

RUN apt-get update && \    
apt-get upgrade --yes --no-install-recommends && \    
apt-get clean

ENV PYTHONUNBUFFERED=1

devcontainer.json

{
    "name": "Backend",
    "dockerComposeFile": [
        "./docker-compose.dev.yaml"
    ],
    "service": "backend",
    "workspaceFolder": "/workspace",

    "customizations": {  
        "vscode": {  
            "extensions": [  
                "ms-python.python",  
            ],  
            "settings": {  
                "python.pythonPath": "${workspaceFolder}/.venv/bin/python",             
                "python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",  
            }  
        }  
    },

    "postCreateCommand": "pip3 install --user -r requirements.txt"
}

🌐
Packetswitch
packetswitch.co.uk β€Ί python-dev-container
How to Containerize Your Python Script with Dev Containers?
August 18, 2024 - A devcontainer.json file in your project tells VS Code how to access (or create) a development container with a well-defined tool and runtime stack. This container can be used to run an application or to separate tools, libraries, or runtimes ...