ITNEXT

ITNEXT is a platform for IT developers & software engineers to share knowledge, connect, collaborate, learn and experience next-gen technologies.

Follow publication

.NET Development in Docker with Dev Containers

Andy Watt
ITNEXT
Published in
8 min readJun 19, 2021

--

Photo by JJ Ying on Unsplash

Now updated for .NET 6.0! — final code here.

In my last post, I configured a development environment for Ethereum development using Docker. This time around, I’ll do the same for .NET.

Building out a development environment in Docker has technically been possible for a while, but the ‘Remote Containers’ extension for Visual Studio Code has taken it to the next level. It’s at the point now where the tooling is mature enough to use on a real world project. In this post, I’ll scaffold a .NET API and build up some of the basic tooling that you would expect in a ‘normal’ dev environment, but I’ll run it all in a Docker container!

Before we get started, let’s recap some of the reasons for doing this in the first place:

  • Consistency across all developer environments, which means an end to “well it works on my machine”.
  • On boarding new developers is incredibly easy — they just pull the repo and all of the dev dependencies are already there.
  • Updating every dev machine is also incredibly easy.
  • The requirements to build and run the project on a dev machine are expressed as code, and move with the repo. (Extending the concept of ‘infrastructure as code’ to also include the dev environment)
  • You don’t need to ‘pollute’ your machine with the dependencies for every single project you are working on.
  • It is not mandatory. If any dev in the team has an aversion to Docker for whatever reason, they can simply opt out and not use the Docker functionality.
  • The environment you are working in is tailored to the project you are working on.

Prerequisites

Photo by Kelly Sikkema on Unsplash

There’s a few prerequisites for this. I am assuming a decent understanding of Docker, VSCode, and Linux / WSL. Whatever machine you are using needs to have installed:

--

--

Published in ITNEXT

ITNEXT is a platform for IT developers & software engineers to share knowledge, connect, collaborate, learn and experience next-gen technologies.

Written by Andy Watt

Technical Lead and co-founder at Avalone Consultants. Angular, .NET, and blockchain developer.

No responses yet

Write a response