By Tim King February 14, 2025
Dev Containers: Achieving Isolation
The concept of dev containers, while seemingly a recent trend, has roots that stretch back to the early days of containerization technology. While the term “dev container” itself has solidified more recently, the underlying idea of using containers for development environments has been evolving for years.

Early adopters of containerization technologies like Docker, which emerged in 2013, quickly realized the potential for creating consistent and isolated development environments. Developers began experimenting with using Docker to encapsulate their project dependencies and tooling, eliminating the “works on my machine” problem. However, these early setups often required significant manual configuration and lacked standardized tooling.
As containerization gained popularity, the need for a more streamlined and manageable approach to containerized development became apparent. Tools and practices began to emerge to simplify the process of defining, building, and running development containers. The rise of infrastructure-as-code and configuration management tools further contributed to the ability to automate and standardize dev container setups.
Microsoft’s introduction of the Remote - Containers extension for Visual Studio Code in 2019 marked a significant turning point. This extension brought the concept of dev containers to the forefront, providing a user-friendly and integrated experience within a popular IDE. It popularized the use of a devcontainer.json file to define the development environment, making it easier to share and reproduce dev container configurations. This standardization played a crucial role in the widespread adoption of dev containers.
The Open Containers Initiative (OCI) also played a role by establishing standards for container formats and runtimes, ensuring interoperability between different containerization tools. This standardization made it easier to create and share dev containers across different platforms and environments.
Since then, the dev container ecosystem has continued to grow and evolve. The development of dev container features, as discussed earlier, has further simplified the process of configuring development environments. Cloud providers have also embraced the concept, offering services like GitHub Codespaces and Gitpod that allow developers to run dev containers in the cloud.
In short, the history of dev containers is a story of gradual evolution, driven by the desire for more consistent, reproducible, and portable development environments. From early experiments with Docker to the standardization of configuration files and the rise of cloud-based solutions, dev containers have become an essential tool for modern software development.
What are Dev Containers?

Setting Up Dev Containers
--- config: showSequenceNumbers: true theme: Neutral --- graph LR A[Install tools] --> B["Configure container"] B --> C[Install extensions] C --> D[Begin Coding]
Let us proceed with the process of setting up a dev container for your project:
-
Step 1: Install Docker Ensure that Docker is installed on your machine, as dev containers are essentially Docker containers.
-
Step 2: Install VSCode and Remote Containers Extension Download and install Visual Studio Code. Subsequently, install the Remote - Containers extension from the Extensions view within VSCode.
-
Step 3: Create a Dev Container Configuration In your project folder, create a directory named .devcontainer.
-
Step 4: Create devcontainer.json and Dockerfile Within the .devcontainer directory, create a devcontainer.json file and a Dockerfile or reference an existing Docker image.
Example devcontainer.json:
{
"name": "My Dev Container",
"image": "mcr.microsoft.com/devcontainers/javascript-node”,
"customization": {
"vscode": {
"settings”: {},
"extensions”: ["ms-vscode.vscode-typescript-tslint-plugin”],
}
},
"postCreateCommand”: "npm install"
}
- Step 5: Open Folder in Container Open VSCode, press F1, and select Remote-Containers: Open Folder in Container….
- Step 6: Select Your Project Folder: Launch Visual Studio Code (VSCode) and select your project folder. VSCode will construct the container image and commence the container’s execution.
- Step 7: Begin Coding: Upon the container’s successful startup, your VSCode environment will establish a connection with the container, incorporating all the specified settings and extensions.
Enhancing Performance on macOS with OrbStack:

Docker Compose and Custom Dockerfiles
- Docker Compose: Enables the definition of multi-container applications, which is particularly useful for projects involving multiple services, such as a web server, database, or cache. These services can be defined in a docker-compose.yml file and referenced in the devcontainer.json file.
- Custom Dockerfiles: Create a custom Dockerfile to define your own container image. This grants you complete control over the environment, allowing you to install specific tools and dependencies that your project necessitates.
Dev Container features
Dev Container features are pre-built, configurable extensions that enhance your development environment within a container. Think of them as modular building blocks you can easily add to your devcontainer setup to quickly equip it with the tools and configurations you need for a specific language, framework, or toolset.
Instead of manually installing and configuring everything from scratch inside your devcontainer, features let you declare what you need in your devcontainer.json file. When you build or rebuild your devcontainer, these features are automatically installed and configured, saving you time and ensuring consistency across your development environments.
For example, if you’re working on a Node.js project, you can use the node feature to automatically install Node.js (and optionally, package managers like npm, yarn, or pnpm) within your devcontainer. Similarly, if you’re working with Python, the python feature can install Python and related tools. There are features for Docker (allowing you to use Docker inside your devcontainer or access the host’s Docker daemon), common utilities, and many more.
Essentially, Dev Container features streamline the process of setting up a consistent and reproducible development environment within a container, allowing you to focus on coding rather than environment configuration. They promote best practices by providing tested and reliable configurations for common development tasks.
The most popular Dev Container features are:
- Common Utilities: Provides a set of essential tools and utilities for development, including bash, curl, git, and more.
- Docker (Docker-in-Docker): Allows you to run Docker containers within your development container, enabling nested virtualization and complex container orchestration scenarios.
- Docker (docker-outside-of-docker): Provides access to the host machine’s Docker daemon, allowing you to interact with existing Docker containers or build new ones.
- Node.js (via nvm), yarn and pnpm: Installs Node.js, Yarn, and pnpm, popular package managers for JavaScript development.
- Python: Installs Python, a versatile and widely used programming language.
- Visual Studio Code: Provides a seamless integration with Visual Studio Code, allowing you to easily manage and work with your dev containers.
These are just a few of the many available Dev Container features. You can find a comprehensive list and detailed descriptions on the official Dev Container Features repository: https://containers.dev/features
Dev Container Support Across IDEs and Editors
Dev containers are not exclusive to VSCode; they are also supported by various other IDEs and editors:
- Cursor: This editor supports dev containers, enabling developers to maintain consistent environments across different projects.
- JetBrains IDEs: JetBrains has integrated support for Docker containers, allowing dev container usage in IDEs like IntelliJ IDEA and PyCharm.
- Open Source VSCode Versions: Many IDEs based on the open-source version of VSCode, such as VSCodium, also support dev containers, providing similar functionality within a more open ecosystem.
Limitations of Using OSS-Based VSCode Versions for .NET Development
When utilising open-source versions of VSCode for .NET development, it is essential to consider the following limitations:
- Lack of Official Support: Open-source versions may not have official support for specific .NET tools and extensions, potentially limiting functionality.
- Missing Extensions: Some extensions available in the official VSCode Marketplace may not be available or fully functional in open-source versions, particularly those related to .NET development.
- Telemetry Features: Open-source versions of Visual Studio Code (VSCode) often lack telemetry and other features present in the official Microsoft VSCode. This could potentially impact the user experience.
- Microsoft .Net Debugger: It is noteworthy that the Microsoft .Net Debugger is not supported in editors based on the open-source version of VSCode.
Advantages of Dev Containers:
- Consistency: Ensures that all team members work in a consistent environment.
- Isolation: Isolates dependencies for different projects.
- Portability: Easily shares configurations through version control.
- Simplicity: Simplifies the process of setting up new development environments.
Disadvantages of Dev Containers:
- Performance Overhead: Running containers may be slower compared to direct local execution.
- Learning Curve: Requires an understanding of Docker and container orchestration.
Customization Options:
- Settings: You can specify VSCode settings in the devcontainer.json file to tailor the environment.
- Extensions: Pre-install VSCode extensions to be used inside the container.
- Lifecycle Commands: Use lifecycle commands e.g. postCreateCommand to run scripts or commands after the container starts.
Remote Development
Running devcontainers in the cloud takes the benefits of containerized development environments to the next level, offering increased flexibility, scalability, and accessibility. Instead of running your development container on your local machine, you leverage cloud resources to host and manage your dev environment. This approach unlocks several advantages:
- Accessibility: Access your development environment from anywhere with an internet connection. No more being tied to a specific machine. This is particularly beneficial for distributed teams or developers who switch between devices.
- Scalability: Easily scale your development resources as needed. Need more CPU or memory for a resource-intensive task? Spin up a larger cloud instance with minimal effort.
- Consistency: Ensure consistent development environments across your team. Cloud-based devcontainers eliminate the “works on my machine” problem by providing a standardized environment that everyone shares. Reduced Local Overhead: Free up local resources by offloading the development workload to the cloud. This can be especially helpful for developers working on less powerful machines or with limited local storage.
- Security: Cloud providers often offer enhanced security features, protecting your code and data.
Several cloud providers offer services that facilitate running devcontainers in the cloud:
- GitHub Codespaces: Seamlessly integrates with GitHub, allowing you to spin up devcontainers directly from your repositories. It offers a browser-based editor or integration with VS Code. https://github.com/features/codespaces
- Gitpod: Another popular option that provides automated and pre-built development environments in the cloud, triggered directly from your Git repositories. https://www.gitpod.io/
- Visual Studio Code Remote - Containers: While not strictly cloud-based in itself, the VS Code Remote - Containers extension can be used in conjunction with cloud VMs or container orchestration platforms like Kubernetes to create a cloud-based devcontainer setup. You would manage the VM or Kubernetes cluster separately. https://code.visualstudio.com/docs/remote/containers
Documentation and Further Reading:
Creating a dev container requires initial effort, but the benefits of having a consistent and isolated environment can significantly enhance productivity and collaboration. It is a worthwhile investment for any serious development project.