JD.MSBuild.Containers Documentation

Welcome to the JD.MSBuild.Containers documentation site. This library provides enterprise-grade MSBuild integration for Docker containerization, enabling automatic Dockerfile generation and Docker builds directly from your .NET project files.

What is JD.MSBuild.Containers?

JD.MSBuild.Containers is an MSBuild-integrated containerization library that automates Docker workflows for .NET applications. It eliminates manual Dockerfile creation and Docker CLI steps by integrating container operations directly into your MSBuild pipeline.

Key Features

  • Automatic Dockerfile Generation - Create optimized multi-stage Dockerfiles during build
  • Granular Control - Enable/disable features independently (generate, build, run, push)
  • Zero Manual Steps - Everything happens during dotnet build or dotnet publish
  • CI/CD Ready - Full GitHub Actions and Azure DevOps support
  • Incremental Builds - Smart fingerprinting skips unchanged files
  • Pre/Post Scripts - Execute custom scripts at any lifecycle stage
  • Multi-Mode Support - Generate-only, build-only, or full automation

Getting Started

Guides & Tutorials

Samples

Reference

  • API Reference - Complete API documentation
  • MSBuild Properties - See API Reference
  • MSBuild Tasks - See API Reference

Quick Start Example

Add the package to your project:

dotnet add package JD.MSBuild.Containers

Enable Docker in your .csproj:

<PropertyGroup>
  <DockerEnabled>true</DockerEnabled>
  <DockerImageName>myapp</DockerImageName>
  <DockerImageTag>latest</DockerImageTag>
</PropertyGroup>

Build your project:

dotnet build

A Dockerfile will be automatically generated. To build the Docker image:

dotnet publish

Support & Contributing

License

This project is licensed under the MIT License. See the LICENSE file for details.