Home Blog Developer Experience and Pl Dev environment standardization: Devcontainers guide
πŸ› οΈ Developer Experience and Pl April 30, 2026 12 min read

Dev environment standardization: Devcontainers guide

Developer Experience and Pl Enterprise Guide 2026 SCALE D2C Developer Experience and Pl Enterprise Guide 2026

Development container standardisation using Dev Containers (formerly devcontainers) is the solution to the "works on my machine" problem that has plagued engineering teams for decades. A Dev Container defines the complete development environment β€” language runtime, tools, extensions, environment variables, ports, and post-creation setup β€” as code in a .devcontainer/devcontainer.json file committed to the repository. Every developer who opens the project gets an identical, reproducible environment in minutes. This guide covers Dev Container architecture, configuration patterns, and enterprise deployment with GitHub Codespaces and VS Code Remote.

What Are Dev Containers?

Dev Containers β€” Definition
The Dev Container specification (open standard, maintained by Microsoft and GitHub, supported by VS Code, JetBrains, and GitHub Codespaces) defines a development environment as a Docker container configured via devcontainer.json. The container provides: the language runtime (Node.js 22, Python 3.12, Java 21, etc.), development tools (CLI tools, test runners, linters), VS Code extensions pre-installed and configured, port forwarding, environment variables, and post-creation setup scripts. Developers open the repo in VS Code or GitHub Codespaces, accept the "Reopen in Container" prompt, and have a fully configured environment in 2–5 minutes β€” regardless of their host OS.

devcontainer.json Configuration Reference

FieldPurposeExample
image / buildBase Docker image or Dockerfile to build from"image": "mcr.microsoft.com/devcontainers/node:22"
featuresAdd tools/runtimes to base image β€” no Dockerfile needed for common tools"ghcr.io/devcontainers/features/docker-in-docker": {}
customizations.vscode.extensionsVS Code extensions installed in containerESLint, Prettier, GitLens, your language extension
customizations.vscode.settingsVS Code settings applied in container β€” enforce code styleFormat on save, linter rules, tab size
forwardPortsPorts exposed from container to host[3000, 5432] for app + database
postCreateCommandRuns once after container creation β€” install dependencies"npm install" or "./scripts/setup.sh"
remoteUserUser to run as in container β€” non-root for security"node"
30 min
Target time from "git clone" to "running tests" with a well-configured Dev Container β€” vs 2–8 hours for manual environment setup from a README. The onboarding improvement compounds across every new hire and every machine rebuild
Codespaces
GitHub Codespaces provides cloud-hosted Dev Containers β€” developers open a browser-based VS Code with the project's Dev Container running on GitHub's infrastructure, with no local Docker required. $0.18/hour for 4-core instances
Features
Dev Container Features β€” community-maintained modules that add tools (Docker, kubectl, Terraform, AWS CLI, etc.) to any base image with one line in devcontainer.json. 200+ features available at containers.dev/features
01
Step 1
Create Your First devcontainer.json

In your project root, create .devcontainer/devcontainer.json. Minimum viable config: {"image": "mcr.microsoft.com/devcontainers/<language>:<version>", "postCreateCommand": "<install-command>"}. Microsoft provides pre-built base images for all major stacks at mcr.microsoft.com/devcontainers/. Add Features for tools you need β€” avoid custom Dockerfiles unless necessary. The Dev Containers extension in VS Code provides a generator UI: Cmd+Shift+P β†’ "Dev Containers: Add Dev Container Configuration Files". Commit to the repository immediately.

.devcontainer/devcontainer.jsonmcr.microsoft.com base imagesFeatures for tools
02
Step 2
Add Multi-Container Support for Services

For projects requiring a database, cache, or other services: use docker-compose.yml alongside devcontainer.json. Add "dockerComposeFile": "docker-compose.yml" and "service": "app" to devcontainer.json β€” the Dev Container runs in the app service while docker-compose brings up PostgreSQL, Redis, etc. alongside. Developers get a complete local stack with one container start. Commit the docker-compose.yml with dev-appropriate configs (no persistent volumes, seeded test data, exposed ports). Our DevOps team implements Dev Container programmes for enterprise engineering organisations.

docker-compose.yml integrationMulti-service stackSeeded test data
03
Enterprise
Codespaces Policy and Governance

For GitHub Codespaces deployment: configure organisation-level policies β€” allowed machine types, idle timeout (default 30 min, set to 60 for developer comfort), retention period for stopped codespaces (14–30 days). Use Dev Container templates at the organisation level for standardised starting points. Publish internal Dev Container features to your GitHub Container Registry for tools unique to your organisation (internal CLI tools, custom certificates, VPN client). Monitor Codespaces cost via the GitHub billing dashboard β€” set per-user spending limits.

Org-level policiesInternal features registrySpending limits
Dev Container Programme Implementation

Our DevOps and software development teams implement Dev Container programmes for enterprise engineering organisations β€” devcontainer.json authoring, Codespaces policy configuration, and developer enablement. Book a free advisory session.

Frequently Asked Questions

End-to-end Developer Experience and Pl strategy, implementation, and optimisation. Contact us for a free consultation.

Strategy: 4–8 weeks. Full implementation: 3–12 months.

Yes β€” D2C brands to enterprise. View our pricing.

DEVELOPER EX

Ready to Implement Developer Experience and Pl?

Our specialist team delivers measurable ROI for enterprise and D2C brands.

Free Audit