Configure options below — the preview updates in real time.
Core dev container settings including name, features, and port forwarding.
A display name for the dev container shown in the UI.
Array of Feature IDs (without version) specifying the desired install order.
Ports to always forward from the container to the local machine (numbers or host:port strings).
Map of port numbers, ranges, or regex patterns to default port options (label, protocol, onAutoForward, etc.).
Default options for ports not explicitly configured in portsAttributes.
Environment variables, user identity, and user env probing.
Name-value pairs that set environment variables for the entire container.
Name-value pairs that set environment variables only for the remote user and UI tools.
Override the user the container runs as (often root by default from the image).
Override the user that devcontainer tools and lifecycle scripts run as inside the container.
Shell type used to probe for user environment variables to include in tool processes.
Runtime behavior, privileged mode, capabilities, mounts, and host requirements.
Action to take when the tool window is closed.
Linux capabilities to add to the container.
Security options applied to the container (e.g. seccomp=unconfined).
Additional volume mounts in Docker mount string format.
Minimum number of CPU cores required on the host.
Minimum RAM required on the host (e.g. 8gb).
Minimum storage required on the host (e.g. 32gb).
Whether a GPU is required. Use true for required, "optional" for optional.
Settings for specifying a base image or building from a Dockerfile.
The Docker image to use for the dev container.
Path to the Dockerfile relative to devcontainer.json.
Docker build context path.
Docker image build target stage.
Build arguments passed as --build-arg to Docker.
Images to use as build cache.
Additional Docker build CLI options.
Additional Docker CLI arguments passed to the docker run command.
Override the default local mount string for the workspace (Image/Dockerfile only).
Settings for dev containers backed by Docker Compose.
Path(s) to Docker Compose files relative to devcontainer.json.
The main service name from the compose file to connect to.
Specific services from the compose file to start (defaults to all).
Workspace folder path settings.
Default path that tools should open when connecting to the container.
Commands executed at various stages of the dev container lifecycle.
Command to run on the local host machine before the container is created.
Command to run inside the container immediately after it is created.
Command to update workspace content (e.g. npm install).
Command to run after the container has been created and started.
Command to run every time the container starts successfully.
Command to run every time a tool or UI attaches to the container.
Which lifecycle script the tool must wait for before allowing user interaction.
VS Code extensions and settings applied inside the dev container.
Extension IDs to install inside the dev container.
Machine-level VS Code settings as key-value pairs.
Get started
1{}