Purview.Containers.Docker
1.0.0-prerelease.5
dotnet add package Purview.Containers.Docker --version 1.0.0-prerelease.5
NuGet\Install-Package Purview.Containers.Docker -Version 1.0.0-prerelease.5
<PackageReference Include="Purview.Containers.Docker" Version="1.0.0-prerelease.5" />
<PackageVersion Include="Purview.Containers.Docker" Version="1.0.0-prerelease.5" />
<PackageReference Include="Purview.Containers.Docker" />
paket add Purview.Containers.Docker --version 1.0.0-prerelease.5
#r "nuget: Purview.Containers.Docker, 1.0.0-prerelease.5"
#:package Purview.Containers.Docker@1.0.0-prerelease.5
#addin nuget:?package=Purview.Containers.Docker&version=1.0.0-prerelease.5&prerelease
#tool nuget:?package=Purview.Containers.Docker&version=1.0.0-prerelease.5&prerelease
Purview.Containers.Docker
The Docker backend for Purview.Containers.Core:
throwaway containers for integration testing on any Docker daemon reachable from the test host — Docker
Desktop, Docker Engine inside WSL2, a remote daemon, Docker-in-Docker, or the daemon a CI runner
provides. It drives the daemon through Testcontainers for .NET.
dotnet add package Purview.Containers.Docker
await using var container = new ContainerBuilder()
.WithImage("alpine:3.19")
.WithCommand("/bin/sh", "-c", "echo ready && sleep 30")
.WithWaitStrategy(Wait.ForLogMessage("ready"))
.Build();
await container.StartAsync();
var result = await container.ExecAsync(["/bin/echo", "hello"]);
Referencing this package makes docker selectable; the module packages need no Docker-specific variant,
because a module reaches the backend through the shared abstractions:
PURVIEW_CONTAINERS_BACKEND=docker # or "auto" (the default) to probe WSLC first, then Docker
| Rule | How |
|---|---|
| Pinned instance | ContainerBackends.Use(new DockerContainerBackend()), or WithBackend(...) |
| Named backend | PURVIEW_CONTAINERS_BACKEND=docker |
| Automatic detection | probe every registered backend; WSLC is preferred when it is usable |
Requirements
- .NET 10 or later, any platform (this package is portable).
- A reachable Docker daemon.
DockerContainerBackend.GetInfoAsync()pings it and reports the server version, or the reason it could not be reached, so a missing daemon is a clear message and not a timeout deep inside a test. - The daemon must accept the standard Testcontainers configuration (
DOCKER_HOST, Docker contexts,~/.testcontainers.properties). The resource reaper (Ryuk) is used, so a crashed test host does not leak containers.
Behaviour notes
- Readiness uses the same shared wait strategies as every other backend (host TCP/HTTP, an in-container command, or a log match), so module behaviour does not change with the backend.
ExecAsyncsupportsWorkingDirectoryandTimeout;EnvironmentandEnableStandardInputthrowContainerNotSupportedExceptionrather than being silently ignored.- Log tailing polls the accumulated output until the container stops, because the Testcontainers API exposes no positioned log stream.
Experimental. The public API, defaults and packaging rules can change between prereleases, and there is no production support guarantee. Pin the exact package version you build against.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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.Telemetry.Abstractions (>= 10.10.0)
- Purview.Containers.Core (>= 1.0.0-prerelease.5)
- Testcontainers (>= 4.15.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Purview.Containers.Docker:
| Package | Downloads |
|---|---|
|
Purview.Containers
Purview.Containers: the umbrella package. Brings the abstractions (Purview.Containers.Core) and both backends (WSL Containers and Docker), so one reference runs the same tests on WSLC on Windows and Docker everywhere else. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-prerelease.5 | 34 | 10/2/2026 |
| 1.0.0-prerelease.4 | 37 | 10/2/2026 |
| 1.0.0-prerelease.3 | 34 | 10/2/2026 |
| 1.0.0-prerelease.2 | 35 | 10/1/2026 |