This repository contains a DevContainer base configuration for a .NET development environment. It provides a consistent, reproducible setup for developers working on .NET projects.
- .NET SDK 6.0
- Azure CLI
- Common development utilities
- Pre-configured VS Code settings and extensions
- Zsh with Oh My Zsh
- Neovim configuration
The DevContainer is defined by several configuration files:
-
.devcontainer/devcontainer.json
: The main configuration file that specifies:- Base image and build instructions
- Ports to forward
- Features to install (including Azure CLI)
- VS Code extensions and settings
- Commands to run on container creation
-
.devcontainer/Dockerfile
: Defines the custom Docker image based on the .NET SDK. -
.devcontainer/on-create.sh
: A script that runs when the container is created, installing additional packages and configuring git. -
.devcontainer/post-create.sh
: A script that runs after the container is created, setting up Neovim configuration.
- Ensure you have Docker and VS Code with the Remote - Containers extension installed.
- Clone this repository.
- Open the repository in VS Code.
- When prompted, click "Reopen in Container" or run the "Remote-Containers: Reopen in Container" command.
- VS Code will build the Docker image and start the container. This may take a few minutes the first time.
- Once the container is running, you'll have a fully configured development environment for .NET.
You can customize the DevContainer by modifying the configuration files:
- Add or remove VS Code extensions in
devcontainer.json
- Modify container features or settings in
devcontainer.json
- Add additional software or configuration in the
Dockerfile
- Modify the setup scripts (
on-create.sh
andpost-create.sh
) to add your own initialization steps
- .NET SDK 6.0
- Azure CLI
- Git
- GitHub Pull Requests and Issues
- Azure Bicep
- GitLens
- EditorConfig
- C# extensions and tools
- PowerShell
- Azure Tools
- IntelliCode
- Prettier
The following ports are forwarded:
- 7071: Azure Functions
- 10000, 10001, 10002: Azurite
- 5000, 5001: ASP.NET Core Web/API App, Blazor App
- 4280: Azure Static Web Apps
- Consistent .NET development environment across team members
- Easy onboarding for new developers
- Isolation from the host system
- Pre-configured for Azure development