6 Reasons to Consider Dev Containers
While the act of developing inside container environments dates back to the mid-2010s, dev containers themselves have gained popularity over the past year. Microsoft pushed the concept forward in 2022 with the introduction of the Dev Container Spec, and Docker followed suit this past summer, rolling out a beta version of its Dev Environments feature.
Where dev containers will go in the future is still an open discussion, but it’s clear that they’re here now, and they’re furthering the trend of developing in a cloud development environment. Dev containers are coding environments encapsulated within containers that enable seamless development, testing and sharing. Developers can create a workspace, start coding, edit their Docker files, restart their workspaces and start fresh.
Enterprises are turning to the Dev Container Spec to regain source control over their dev environments. The spec extends the use of source control repos beyond simply storing source code–everything needed for the build environment is checked in. The repo provides not only the project’s source code but also environment declarations, dotfiles, IDE extensions, build scripts, etc. Need to update the version of Java or have the latest version of Copilot installed? Modify the Dockerfile and create a PR. Need to make sure everyone has a special dotfile? Add it to a branch and create a PR.
Dev containers do have some drawbacks worth noting, however. For one, they only support Docker. The many enterprises that prefer to use Kubernetes or virtual machines (VMs) rather than Docker are out of luck. Plus, there’s no clear path beyond Docker for dev containers. Enterprises are reluctant to give developers the ability to institute specifications for privileges, capabilities and mounts in Kubernetes. You also can’t build custom tooling around dev containers with the traditional Dev Container CLI because it’s not designed for abstraction or extensibility.
At this point, though, the benefits outweigh the drawbacks. To become ubiquitous, support is needed on all container platforms, at least in an abstract way. That can come from company-specific tools or open source contributions. We expect new implementations in the dev container space in the coming years. Coder, for example, introduced its own open source implementation, – envbuilder –, which supports a number of container platforms including Kubernetes, Docker and OpenShift. As the advantages outweigh the drawbacks enterprises currently face, here are six reasons why dev containers are worth looking into:
- Adoption is simple. To get started, a developer just has to install an IDE and Docker, then clone a dev container repo. There are no complications from proprietary formats to write a Docker file. Large enterprises rolling out a dev container environment can leverage their existing experience writing Docker files.
- CDEs are becoming popular. Organizations are pushing to give developers more control of their environments. In the past, when developers wanted to implement new software or change a version during a slow cycle, they had to push a busy central operations team to do it. Now, with dev containers, that feedback loop is changing. Devs can just edit their Docker files and the container build pipeline ends up in the exact same configuration.
- They alleviate resource constraints. Some organizations are running large apps that take a lot of memory and which are difficult to run on laptops. Dev containers running in a CDE are becoming an emerging standard for remote work.
- They’re reproducible. In other words, they solve the “It works on my machine” problem. With dev containers, everyone on the team has the same code, versions and configuration. Dev containers are a good way to standardize the experience inside environments.
- They’re secure. With dev containers, it’s easier to roll out patches and ensure that all developers are up-to-date They can retain their updates and state through rebuilds.
- They improve developer productivity. Like with other declarative technologies, developers don’t have to waste cycles on subtle differences in their environments.
Dev containers are an exciting, emerging technology. While development organizations can take advantage of a number of emerging environments, dev containers are a good fit for the future because they encourage more development in the cloud. They’re easy to operate, give developers more control and provide value for organizations that are doing everything they can to get ahead.