3 minutes
VSCode: fanboying over devcontainers
I’ve been working with Azure recently and was introduced to the Rover, a fully provisioned container for working with Azure Terraform. I hadn’t appreciated Microsoft’s ability to create environments using containers that VSCode can then connect to in an OS-agnostic and portable way. I mainly use my Mac as a dev machine, but I use my gaming PC to do the odd coding task every now and then. Jumping between these devices can be a bit of a pain because I have to set them up the same way. This always comes with some nuance because of the difference between the operating systems.
Below is an example of the dev container that I used to build this blog using Hugo:
And the Dockerfile
:
Credit to Exavolt for the Gist.
Working on my blog is as simple as cloning the repo and running the build in the container. I get the hot reloads and everything run as transparent as when I had the tools installed natively on my machine. As always, the docs from Microsoft are fantastic. To read more, I highly recommend the following articles: