What’s a devcontainer?
Containers made software or applications portable. This initially solved a deployment problem. It meant the dreaded “it works on my machine” days were over. Everything you need to run the application is included in the container.

Devcontainers are just containers that are being used for software development. The name says it all. In this case containers are being extended to solve a development problem. Everything you need to not only run the application but also to develop it is included in the container.
More specifically, it’s an open specification originally created by Microsoft. You can check out here.
Why bother with devcontainers?
Here are a few reasons.
Isolated environments
If you’ve ever needed to install multiple versions of certain tools on your machine and then had issues with them conflicting you know it sucks. This is not uncommon with Python for example. Devcontainers provide an isolated environment. You have one devcontainer that can use an older version of Python for one project and then another devcontainer that is for another project that uses the latest version.
This also means you can keep your machine cleaner as you don’t need to install stacks of packages directly.
On-boarding
If you’ve experienced going through a lengthy README with commands to install a bunch of things and run various scripts to get your dev environment setup, it can be pretty painful. Devcontainers can remove all this manual setup. You just need a container runtime like Docker and then you run the devcontainer.
Also everyone on a team is using the exact same setup. This removes any subtle issues that can occur due to slight differences between local machines.
Remote development
You can run the devcontainer wherever, it doesn’t have to be on your local machine. You could run a devcontainer on a powerful cloud machine and then connect to it from your crappy laptop.
The challenge I faced
The main challenge for me with devcontainers is that they have a great integration with vscode, but I don’t use vscode…
I’m one of those weird folk who actually enjoys using vim or neovim (most of the time).
This requires some additional work to configure a devcontainer to work for me. I want to be able to ssh into the devcontainer and have all my tools available. When I say tools I basically mean my dotfiles. Things like my bashrc and neovim config.
The solution
There are a couple of great projects that help make this pretty smooth. Devpod and Devsy. Devpod works great, the only downside is it seems to be unmaintained at this point. Devsy is kind of a successor to Devpod and is being actively developed. Devsy was not quite as smooth as Devpod to get up and running. This was mainly due to me using Podman. I ran into some problems when building the devcontainer image. I didn’t have any such problems with Devpod.
Through using a tool like Devpod or Devsy you can spin up devcontainers easily and be able to ssh into them. They can even clone your dotfiles as part of creating the devcontainer and will look for an install/setup script to run. They also make it simple to run devcontainers somewhere other than your local machine, such as a kubernetes cluster or a machine in the cloud. This is not something I have tried just yet though.
To sum up
I’ve found devcontainers to be fun and useful. It’s helped me learn a bit about containers and appreciate them way more. It’s also meant I’ve improved my dotfiles setup too. But more about that another time :)