Ductus.FluentDocker
2.85.0
dotnet add package Ductus.FluentDocker --version 2.85.0
NuGet\Install-Package Ductus.FluentDocker -Version 2.85.0
<PackageReference Include="Ductus.FluentDocker" Version="2.85.0" />
<PackageVersion Include="Ductus.FluentDocker" Version="2.85.0" />
<PackageReference Include="Ductus.FluentDocker" />
paket add Ductus.FluentDocker --version 2.85.0
#r "nuget: Ductus.FluentDocker, 2.85.0"
#:package Ductus.FluentDocker@2.85.0
#addin nuget:?package=Ductus.FluentDocker&version=2.85.0
#tool nuget:?package=Ductus.FluentDocker&version=2.85.0
FluentDocker
This library enables docker and docker-compose interactions using a Fluent API. It is supported on Linux, Windows and Mac. It also has support for the legacy docker-machine interactions.
Have a look at the project site for more information.
Sample Fluent API usage
using (
var container =
new Builder().UseContainer()
.UseImage("kiasaki/alpine-postgres")
.ExposePort(5432)
.WithEnvironment("POSTGRES_PASSWORD=mysecretpassword")
.WaitForPort("5432/tcp", 30000 /*30s*/)
.Build()
.Start())
{
var config = container.GetConfiguration(true);
Assert.AreEqual(ServiceRunningState.Running, config.State.ToServiceState());
}
The following snippet fires up Postgres and waits for it to be ready. It uses docker-compose file to perform the task.
var file = Path.Combine(Directory.GetCurrentDirectory(),
(TemplateString) "Resources/ComposeTests/WordPress/docker-compose.yml");
// @formatter:off
using (var svc = new Builder()
.UseContainer()
.UseCompose()
.FromFile(file)
.RemoveOrphans()
.WaitForHttp("wordpress", "http://localhost:8000/wp-admin/install.php")
.Build().Start())
// @formatter:on
{
// We now have a running WordPress with a MySql database
var installPage = await "http://localhost:8000/wp-admin/install.php".Wget();
Assert.IsTrue(installPage.IndexOf("https://wordpress.org/", StringComparison.Ordinal) != -1);
Assert.AreEqual(1, svc.Hosts.Count); // The host used by compose
Assert.AreEqual(2, svc.Containers.Count); // We can access each individual container
Assert.AreEqual(2, svc.Images.Count); // And the images used.
}
👀 It has tons of features, including a low-level command style, services and finally, the Fluent API on top of it.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Newtonsoft.Json (>= 13.0.1)
- SharpCompress (>= 0.29.0)
- System.Runtime.InteropServices.RuntimeInformation (>= 4.3.0)
-
net6.0
- Newtonsoft.Json (>= 13.0.1)
- SharpCompress (>= 0.29.0)
-
net8.0
- Newtonsoft.Json (>= 13.0.1)
- SharpCompress (>= 0.29.0)
NuGet packages (22)
Showing the top 5 NuGet packages that depend on Ductus.FluentDocker:
| Package | Downloads |
|---|---|
|
Ductus.FluentDocker.XUnit
XUnit Support to allow for create, run one or more docker images while testing using docker, compose, machine (Linux, Windows, Mac) using netcore or full framework. Documentation: https://github.com/mariotoffia/FluentDocker |
|
|
Ductus.FluentDocker.MsTest
Ms Test Support to allow for create, run one or more docker images while testing using docker, compose, machine (Linux, Windows, Mac) using netcore or full framework. Documentation: https://github.com/mariotoffia/FluentDocker |
|
|
NinjaTools.FluentMockServer
A C# Client for the MockServer Docker Image |
|
|
Be.Vlaanderen.Basisregisters.DockerUtilities
Docker utilities for C#. |
|
|
CodeDesignPlus.Net.xUnit.Microservice
A library designed to optimize and facilitate unit testing for microservices using xUnit in .NET Core. |
GitHub repositories (7)
Showing the top 7 popular GitHub repositories that depend on Ductus.FluentDocker:
| Repository | Stars |
|---|---|
|
Xabaril/AspNetCore.Diagnostics.HealthChecks
Enterprise HealthChecks for ASP.NET Core Diagnostics Package
|
|
|
danielgerlag/conductor
Distributed workflow server
|
|
|
SQLStreamStore/SQLStreamStore
Stream Store library targeting RDBMS based implementations for .NET
|
|
|
axzxs2001/Asp.NetCoreExperiment
原来所有项目都移动到**OleVersion**目录下进行保留。新的案例装以.net 5.0为主,一部分对以前案例进行升级,一部分将以前的工作经验总结出来,以供大家参考!
|
|
|
nmklotas/GitLabApiClient
GitLab API client
|
|
|
pdevito3/QueryKit
🎛️ QueryKit is a .NET library that makes it easier to query your data by providing a fluent and intuitive syntax for filtering and sorting.
|
|
|
kurrent-io/KurrentDB-Client-Dotnet
KurrentDB .NET Client
|
| Version | Downloads | Last Updated |
|---|---|---|
| 2.85.0 | 79,681 | 7/25/2025 |
| 2.84.0 | 1,163 | 7/25/2025 |
| 2.83.0 | 21,467 | 6/27/2025 |
| 2.82.0 | 548 | 6/27/2025 |
| 2.81.0 | 561 | 6/27/2025 |
| 2.80.0 | 697 | 6/27/2025 |
| 2.79.0 | 1,134 | 6/27/2025 |
| 2.10.59 | 3,129,579 | 1/11/2023 |
| 2.10.57 | 438,990 | 9/24/2022 |
| 2.10.56 | 94,011 | 8/24/2022 |
| 2.10.55 | 166,845 | 6/24/2022 |
| 2.10.54 | 1,762 | 6/24/2022 |
| 2.10.53 | 3,518 | 6/23/2022 |
| 2.10.51 | 35,264 | 6/7/2022 |
| 2.10.50 | 2,177 | 6/7/2022 |
| 2.10.48 | 11,804 | 5/30/2022 |
| 2.10.46 | 2,172 | 5/30/2022 |
| 2.10.45 | 326,823 | 3/9/2022 |
| 2.10.44 | 333,007 | 12/8/2021 |
| 2.10.42 | 155,198 | 11/24/2021 |
| 2.10.41 | 8,643 | 11/23/2021 |
| 2.10.40 | 42,289 | 10/27/2021 |
| 2.10.39 | 30,583 | 10/1/2021 |
| 2.10.35 | 1,537 | 10/1/2021 |
| 2.10.25 | 1,813 | 10/1/2021 |
| 2.10.23 | 1,927 | 10/1/2021 |
| 2.10.22 | 8,000 | 9/29/2021 |
| 2.10.21 | 24,132 | 9/19/2021 |
| 2.10.20 | 2,209 | 9/17/2021 |
| 2.10.19 | 1,413 | 9/16/2021 |
| 2.10.17 | 1,606 | 9/16/2021 |
| 2.10.16 | 1,629 | 9/15/2021 |
| 2.10.15 | 1,404 | 9/15/2021 |
| 2.10.14 | 2,825 | 9/14/2021 |
| 2.10.12 | 1,507 | 9/14/2021 |
| 2.10.10 | 14,729 | 9/13/2021 |
| 2.10.8 | 1,511 | 9/13/2021 |
| 2.10.7 | 141,392 | 6/11/2021 |
| 2.10.6 | 92,953 | 4/23/2021 |
| 2.10.5 | 13,352 | 4/20/2021 |
| 2.10.3 | 11,665 | 4/5/2021 |
| 2.10.2 | 50,381 | 3/28/2021 |
| 2.9.4 | 1,713 | 3/26/2021 |
| 2.9.3-beta.2 | 845 | 3/25/2021 |
| 2.8.14-beta.22 | 364 | 3/24/2021 |
| 2.8.13-beta.21 | 344 | 3/24/2021 |
| 2.8.12-beta.20 | 347 | 3/23/2021 |
| 2.8.11-beta.19 | 308 | 3/22/2021 |
| 2.8.10-beta.18 | 323 | 3/22/2021 |
| 2.8.9-beta.17 | 348 | 3/22/2021 |
| 2.8.8-beta.14 | 314 | 3/17/2021 |
| 2.8.7-beta.9 | 347 | 3/11/2021 |
| 2.8.5-beta.4 | 420 | 3/7/2021 |
| 2.8.5-beta.2 | 307 | 3/24/2021 |
| 2.8.4-beta.3 | 319 | 3/3/2021 |
| 2.8.3 | 2,660 | 3/24/2021 |
| 2.8.2 | 21,833 | 3/3/2021 |
| 2.7.80-beta.159 | 406 | 3/1/2021 |
| 2.7.71-beta.150 | 4,705 | 11/27/2020 |
| 2.7.69-beta.147 | 4,963 | 10/12/2020 |
| 2.7.68-beta.146 | 6,616 | 10/8/2020 |
| 2.7.66-beta.142 | 2,040 | 8/8/2020 |
| 2.7.65-beta.141 | 400 | 8/7/2020 |
| 2.7.64-beta.140 | 488 | 8/6/2020 |
| 2.7.62-beta.138 | 7,209 | 5/4/2020 |
| 2.7.60-beta.127 | 459 | 4/30/2020 |
| 2.7.59-beta0123 | 1,746 | 2/13/2020 |
| 2.7.58-beta0122 | 1,315 | 2/12/2020 |
| 2.7.54-beta0117 | 2,679 | 1/23/2020 |
| 2.7.53-beta0116 | 1,471 | 1/23/2020 |
| 2.7.52-beta0105 | 1,429 | 1/20/2020 |
| 2.7.51-beta0102 | 4,441 | 1/14/2020 |
| 2.7.50-beta0094 | 1,445 | 12/20/2019 |
| 2.7.49-beta0091 | 1,407 | 12/18/2019 |
| 2.7.48-beta0087 | 1,485 | 12/17/2019 |
| 2.7.47-beta0081 | 1,347 | 12/17/2019 |
| 2.7.46-beta0080 | 3,083 | 12/16/2019 |
| 2.7.45-beta0079 | 1,460 | 12/12/2019 |
| 2.7.44-beta0078 | 1,418 | 12/12/2019 |
| 2.7.42-beta0076 | 1,341 | 12/12/2019 |
| 2.7.41-beta0075 | 1,333 | 12/12/2019 |
| 2.7.38-beta0072 | 2,885 | 11/24/2019 |
| 2.7.37-beta0071 | 1,486 | 11/24/2019 |
| 2.7.36-beta0070 | 1,371 | 11/24/2019 |
| 2.7.35-beta0069 | 1,333 | 11/20/2019 |
| 2.7.34-beta0068 | 1,305 | 11/20/2019 |
| 2.7.33-beta0067 | 1,423 | 11/20/2019 |
| 2.7.32-beta0066 | 1,348 | 11/12/2019 |
| 2.7.31-beta0064 | 1,458 | 11/12/2019 |
| 2.7.30-beta0050 | 1,309 | 11/8/2019 |
| 2.7.29-beta0046 | 1,359 | 11/8/2019 |
| 2.7.28-beta0045 | 1,318 | 11/8/2019 |
| 2.7.27-beta0043 | 1,373 | 11/8/2019 |
| 2.7.21-beta0036 | 1,336 | 11/8/2019 |
| 2.7.20-beta0032 | 1,381 | 11/8/2019 |
| 2.7.19-beta0030 | 1,413 | 11/8/2019 |
| 2.7.4-beta0001 | 1,341 | 11/8/2019 |
| 2.7.3 | 645,700 | 10/18/2019 |
| 2.7.2 | 12,535 | 9/10/2019 |
| 2.7.1 | 194,605 | 8/7/2019 |
| 2.7.0 | 2,470 | 8/6/2019 |
| 2.6.9 | 5,430 | 7/29/2019 |
| 2.6.8 | 51,759 | 5/31/2019 |
| 2.6.7 | 2,416 | 5/17/2019 |
| 2.6.6 | 4,935 | 4/11/2019 |
| 2.6.5 | 3,293 | 4/2/2019 |
| 2.6.4 | 14,812 | 12/6/2018 |
| 2.6.3 | 5,971 | 10/15/2018 |
| 2.6.2 | 2,143 | 10/3/2018 |
| 2.6.1 | 1,988 | 10/3/2018 |
| 2.6.0 | 2,017 | 10/2/2018 |
| 2.5.1 | 2,393 | 9/29/2018 |
| 2.5.0 | 1,909 | 9/29/2018 |
| 2.4.1 | 2,014 | 9/27/2018 |
| 2.4.0 | 2,060 | 9/18/2018 |
| 2.3.2 | 3,557 | 8/6/2018 |
| 2.3.1 | 2,430 | 7/20/2018 |
| 2.3.0 | 2,735 | 7/2/2018 |
| 2.2.19 | 2,828 | 6/27/2018 |
| 2.2.18 | 2,508 | 6/25/2018 |
| 2.2.17 | 2,525 | 6/15/2018 |
| 2.2.16 | 2,409 | 6/14/2018 |
| 2.2.15 | 6,147 | 6/7/2018 |
| 2.2.14 | 2,487 | 6/1/2018 |
| 2.2.13 | 2,824 | 5/22/2018 |
| 2.2.12 | 4,164 | 4/20/2018 |
| 2.2.11 | 2,520 | 4/18/2018 |
| 2.2.10 | 2,917 | 4/17/2018 |
| 2.2.9 | 2,516 | 4/6/2018 |
| 2.2.8 | 6,393 | 11/22/2017 |
| 2.2.7 | 2,519 | 11/22/2017 |
| 2.2.6 | 2,446 | 11/21/2017 |
| 2.2.5 | 3,569 | 11/9/2017 |
| 2.2.4 | 2,432 | 11/9/2017 |
| 2.2.3 | 2,525 | 8/25/2017 |
| 2.2.2 | 2,947 | 5/22/2017 |
| 2.2.1 | 2,517 | 4/6/2017 |
| 2.2.0 | 2,147 | 6/5/2016 |
| 2.1.1 | 2,101 | 5/27/2016 |
| 2.0.0 | 2,806 | 4/24/2016 |
| 1.1.4 | 2,038 | 3/31/2016 |
| 1.1.3 | 2,471 | 3/30/2016 |
| 1.1.2 | 2,226 | 3/30/2016 |
| 1.1.1 | 2,451 | 3/29/2016 |
| 1.1.0 | 2,089 | 3/29/2016 |
| 1.0.3 | 2,267 | 3/24/2016 |
| 1.0.2 | 2,621 | 3/23/2016 |
| 1.0.1 | 2,854 | 3/23/2016 |
| 1.0.0 | 3,964 | 3/23/2016 |