FluentDocker 3.0.1
dotnet add package FluentDocker --version 3.0.1
NuGet\Install-Package FluentDocker -Version 3.0.1
<PackageReference Include="FluentDocker" Version="3.0.1" />
<PackageVersion Include="FluentDocker" Version="3.0.1" />
<PackageReference Include="FluentDocker" />
paket add FluentDocker --version 3.0.1
#r "nuget: FluentDocker, 3.0.1"
#:package FluentDocker@3.0.1
#addin nuget:?package=FluentDocker&version=3.0.1
#tool nuget:?package=FluentDocker&version=3.0.1
FluentDocker
Fluent API for managing Docker and Podman containers, images, networks, and volumes in .NET. Supports Docker CLI, Docker Engine API, Podman CLI, and Docker Compose. Runs on Linux, macOS, and Windows.
Installation
dotnet add package FluentDocker
Testing framework integration (pick one):
dotnet add package FluentDocker.Testing.Xunit
dotnet add package FluentDocker.Testing.NUnit
dotnet add package FluentDocker.Testing.MsTest
Quick Start
Docker CLI
using FluentDocker.Builders;
using FluentDocker.Kernel;
await using var kernel = FluentDockerKernel.Create()
.WithDockerCli("docker", d => d.AsDefault())
.Build();
await using var results = await new Builder()
.WithinDriver("docker", kernel)
.UseContainer(c => c
.UseImage("postgres:15-alpine")
.ExposePort("5432")
.WithEnvironment("POSTGRES_PASSWORD", "mysecretpassword")
.WaitForPort("5432/tcp", 30000))
.BuildAsync();
var container = results.Containers.First();
// Container is running and ready to accept connections on port 5432
Docker Engine API (no CLI required)
await using var kernel = FluentDockerKernel.Create()
.WithDockerApi("docker-api", d => d.AsDefault())
.Build();
// Same builder API — just a different driver
await using var results = await new Builder()
.WithinDriver("docker-api", kernel)
.UseContainer(c => c
.UseImage("redis:7-alpine")
.ExposePort("6379")
.WaitForPort("6379/tcp", 10000))
.BuildAsync();
Podman
await using var kernel = FluentDockerKernel.Create()
.WithPodmanCli("podman", d => d.AsDefault())
.Build();
await using var results = await new Builder()
.WithinDriver("podman", kernel)
.UseContainer(c => c
.UseImage("docker.io/library/nginx:alpine")
.ExposePort("80"))
.BuildAsync();
Docker Compose
await using var results = await new Builder()
.WithinDriver("docker", kernel)
.UseCompose(c => c
.WithComposeFile("docker-compose.yml")
.WithProjectName("myapp")
.WithForceRecreate())
.BuildAsync();
Networks and Volumes
await using var results = await new Builder()
.WithinDriver("docker", kernel)
.UseNetwork(n => n
.WithName("my-net")
.UseDriver("bridge")
.WithSubnet("172.28.0.0/16")
.RemoveOnDispose())
.UseVolume(v => v
.WithName("my-data")
.UseDriver("local")
.RemoveOnDispose())
.UseContainer(c => c
.UseImage("postgres:15-alpine")
.WithNetwork("my-net")
.WithVolume("my-data:/var/lib/postgresql/data"))
.BuildAsync();
Features
- Multi-driver kernel — run Docker CLI, Docker API, and Podman side by side
- Fluent builder — containers, networks, volumes, compose, pods
- Wait conditions — port, HTTP, process, log, health check, custom lambda
- Async-first — all operations are async with
CancellationTokensupport - Auto-cleanup — resources are disposed when the builder result is disposed
- Testing integration — xUnit, NUnit, and MSTest fixtures with full lifecycle management
- Security options — capabilities, read-only root, security-opt, user namespace
- Cross-platform — Linux, macOS, Windows; .NET 8 and .NET 10
Documentation
Full documentation, architecture guides, and advanced examples are available at the project repository.
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.3)
- SharpCompress (>= 0.48.0)
-
net8.0
- Microsoft.Extensions.Logging.Abstractions (>= 9.0.3)
- SharpCompress (>= 0.48.0)
- System.IO.Pipelines (>= 9.0.3)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on FluentDocker:
| Package | Downloads |
|---|---|
|
FluentDocker.Testing.NUnit
Spin up and tear down Docker and Podman containers, networks, volumes, and Compose stacks directly in your NUnit tests. Manages the full resource lifecycle so your integration tests run against real services with zero manual cleanup. |
|
|
FluentDocker.Testing.MsTest
Spin up and tear down Docker and Podman containers, networks, volumes, and Compose stacks directly in your MSTest tests. Manages the full resource lifecycle so your integration tests run against real services with zero manual cleanup. |
|
|
FluentDocker.Testing.Xunit
Spin up and tear down Docker and Podman containers, networks, volumes, and Compose stacks directly in your xUnit tests. Manages the full resource lifecycle as async fixtures so your integration tests run against real services with zero manual cleanup. |
GitHub repositories
This package is not used by any popular GitHub repositories.