NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
NuGet
NuGet, #879 most downloaded on NuGet
Testcontainers for .NET is a library to support tests with throwaway instances of Docker containers for all compatible .NET Standard versions.
Latest stable
4.17.0
Last release 6 days ago
16 Nov 2026
Ships fairly regularly
a new release about every 6 weeks
Nearly every release is documented
notes for 30 of 30 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
30 releases · first in 2023
Drag across the ruler to compare, or tap a release to open it.
Thanks to everyone who contributed and shared their feedback 🤜🤛.
Thanks to everyone who contributed and shared their feedback 🤜🤛.
The NuGet packages for this release have been attested for supply chain security using actions/attest. This confirms the integrity and provenance of the artifacts and helps ensure they can be trusted: #68254162.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Huge thanks to everyone for your contributions and feedback 🧡.
Huge thanks to everyone for your contributions and feedback 🧡.
The NuGet packages for this release have been attested for supply chain security using actions/attest. This confirms the integrity and provenance of the artifacts and helps ensure they can be trusted: #54051351.
The NuGet packages for this release have been attested for supply chain security using actions/attest . This confirms the integrity and provenance of
The NuGet packages for this release have been attested for supply chain security using actions/attest. This confirms the integrity and provenance of the artifacts and helps ensure they can be trusted: #45594466.
I published this version because several developers asked for a release addressing the SSH.NET vulnerability. As an interim fix, you can also bump the…
I published this version because several developers asked for a release addressing the SSH.NET vulnerability. As an interim fix, you can also bump the transitive dependency, which should work fine.
Unfortunately, I had to run the release CI pipeline twice (1, 2). The change #1725 introduced a regression that caused the pipeline to attempt to publish the Cake build project, which correctly failed (partially published).
The NuGet packages for this release have been attested for supply chain security using actions/attest. This confirms the integrity and provenance of the artifacts and helps ensure they can be trusted: #40693051.
Thank you to everyone who contributed and shared their feedback 🤜🤛.
Thank you to everyone who contributed and shared their feedback 🤜🤛.
The NuGet packages for this release have been attested for supply chain security using actions/attest. This confirms the integrity and provenance of the artifacts and helps ensure they can be trusted: #33686956.
The NuGet packages for this release have been attested for supply chain security using actions/attest . This confirms the integrity and provenance of
Thanks to all contributors 👏.
The NuGet packages for this release have been attested for supply chain security using actions/attest. This confirms the integrity and provenance of the artifacts and helps ensure they can be trusted: #28009236.
Thanks to all contributors. Once again, really great contributions from everyone 🤝.
Thanks to all contributors. Once again, really great contributions from everyone 🤝.
The NuGet packages for this release have been attested for supply chain security using actions/attest. This confirms the integrity and provenance of the artifacts and helps ensure they can be trusted: #21198535.
Please be aware that we have changed the supported and underlying image used for the Cosmos DB module. The latest tag only supports certain environments and provides a limited set of features. Microsoft has introduced a new implementation, vnext-preview, which receives more updates and features. Due to the limitations of the latest tag, we decided to replace it with vnext-preview. You find more information about the image here: https://github.com/Azure/azure-cosmos-db-emulator-docker.
Please note that going forward, we expect developers to explicitly pin the image version ( https://github.com/testcontainers/testcontainers-dotnet/dis
Happy New Year, everyone! 🎉
Please note that going forward, we expect developers to explicitly pin the image version (https://github.com/testcontainers/testcontainers-dotnet/discussions/1470). We consider this a best practice and it aligns with other language implementations.
Also, due to the recent Docker Engine v29 release, TC for .NET pins the Docker Engine API version to 1.44 (see the previous release notes). You can override this default and set it to the version you're using, ideally 1.52, which corresponds to v29, if you're already running it.
This was needed because Docker Engine v29 introduced breaking changes that affect Docker.DotNet and Testcontainers for .NET. This release pins the API…
This release adds a new configuration (DOCKER_API_VERSION) that lets you pin and downgrade the Docker Engine API version. This was needed because Docker Engine v29 introduced breaking changes that affect Docker.DotNet and Testcontainers for .NET. This release pins the API version to 1.44. So far, no issues or negative side effects have been observed.
I am also working on updating Docker.DotNet to make it fully compatible with Docker Engine v29. There is already a work-in-progress PR.
Thanks to all the contributors who helped with this release 👍.
fix: Compute correct relative Dockerfile file path ( #1558 ) @HofmeisterAn
Thank you to all the contributors 🙌.
Thank you to all the contributors 🙌.
In version 4.7.0, we noticed that the reuse hash could change depending on the order of dictionary values. This has been fixed to ensure that dictionary values are processed in a consistent order when generating the reuse hash. As a result, the reuse hash will likely change again with 4.8.0.
Wait strategies now default to the Running mode. This mode expects the container to remain running throughout startup. If the container exits unexpectedly, Testcontainers will throw a ContainerNotRunningException that includes the exit code and container logs.
The container startup callback now includes an additional overload that provides the actual container configuration. If you implement IContainerBuilder<TBuilderEntity, TContainerEntity>, you need to add the container configuration (e.g., IContainerConfiguration) as a third generic type constraint to IContainerBuilder.
IContainerBuilder.WithResourceMapping and IContainer.CopyAsync now include two new optional arguments: uid and gid. If you do not need to specify those, use named arguments for the existing parameters: fileMode or ct.
WithTarget(string) to image builder (#1534) @HofmeisterAndb.runCommand({hello:1}) do detect readiness (#1548) @HofmeisterAnIContainerBuilder.WithAutoRemove code comment (#1546) @hojmarkUntilPortIsAvailable(int) (#1528) @HofmeisterAnThis release doesn't introduce breaking changes to the public API, but it isn't binary compatible due to necessary internal changes. Make sure to upda…
This release doesn't introduce breaking changes to the public API, but it isn't binary compatible due to necessary internal changes. Make sure to update all related packages (Testcontainers modules) to the same version. See more details here. Thanks to all contributors 👏.
.slnx (solution) file in common directory paths (#1492) @alexander-jesner-APThis is a patch release (but the minor version was already set). It fixes a bug in our Docker.DotNet fork where a wrong HTTP Connection header break P
This is a patch release (but the minor version was already set). It fixes a bug in our Docker.DotNet fork where a wrong HTTP Connection header break Podman and possibly other environments. Shipped a quick fix. Thanks again to @ahaeber and @victor-lambret for the help.
Big thanks to everyone who contributed to this release 🤜🤛.
Big thanks to everyone who contributed to this release 🤜🤛.
Task<ExecResult> extension method ThrowOnFailure (#1448) @HofmeisterAnDockerUnavailableException when Docker is not available (#1308) @0xced3.128.1 (#1443) @HofmeisterAnTime for a new release! Big thanks to everyone who helped out with this one. It's got some awesome new features and fixes 😎. Seriously, I can't thank
Time for a new release! Big thanks to everyone who helped out with this one. It's got some awesome new features and fixes 😎. Seriously, I can't thank you enough. This wouldn't be possible without your ongoing support 🙏.
WithName(IImage) (#1413) @HofmeisterAnCreatedTime for UntilMessageIsLogged wait strategy (#1384) @0xcedtestcontainers/helloworld image in docs to version 1.2.0 (#1419) @VishnuJinThank you to all the contributors 🙌.
Thank you to all the contributors 🙌.
SharedContainerInstance and use ContainerFixture instead (#1378) @0xcedThanks for all the contributions. Great first release of the year ❤️.
Thanks for all the contributions. Great first release of the year ❤️.
This is likely the last release for this year, unless urgent fixes become necessary.
This is likely the last release for this year, unless urgent fixes become necessary.
I want to mention a change introduced in the last major release, where we refactored the IImage interface. As part of this update, we removed obsolete properties and overloaded constructors. If you previously used an overload other than DockerImage(string), please ensure you pass the correct values to the constructor.
Additionally, we replaced Docker.DotNet with our own fork to keep the Docker Engine API up to date. Our goal is to improve reliability and performance while offering a more developer-friendly and convenient client. If you depend on a Docker client for .NET, we encourage you to contribute to this project ❤️.
On a personal note, I wish everyone a peaceful and lovely holiday season. Take this time to rest, connect with loved ones, and recharge for the new year. Take care.
net6.0 and add net9.0 TFM (#1311) @HofmeisterAnDbContainerFixture to match the behavior of ContainerFixture (#1310) @0xcedThanks so much for all the effort you put into this release 🙌. We are continuing to align Testcontainers for .NET with other language implementations
Thanks so much for all the effort you put into this release 🙌. We are continuing to align Testcontainers for .NET with other language implementations and working on improving the domain-specific language.
We have updated the IImage interface to follow the domain-specific language with the correct property names. The table below shows the changes. We tried to make the transition as smooth as possible, but be aware that relying on the Repository property might cause issues since it now resolves a different value than before. We have kept the old properties, marked them as obsolete, and provided guidance on how to migrate.
| Actual | Expected (New) | |
|---|---|---|
| Registry | - | myregistryhost:5000 |
| Repository | myregistryhost:5000/fedora | fedora/httpd |
| Name | httpd | - |
| Tag | version1.0 | version1.0 |
| Digest | - | sha256:37a3b014d320... |
| GetHostname() | myregistryhost:5000 | myregistryhost:5000 |
IImage properties with Docker DSL (#1256) @HofmeisterAnexec to replace current shell with the Kafka process (as ENTRYPOINT) (#1282) @jasoncoutureWithEnterpriseEdition(bool)) (#1269) @SossenbinderIImage, DockerImage and in the WithImage(string) implementation (#1249) @KielekIImage properties with Docker DSL (#1256) @HofmeisterAnAccountName and AccountKey to public, move to AzuriteBuilder (#1258) @mikecoleHey everyone, just wanted to say a huge thanks to all of you who helped with this version — whether through contributions, reporting issues, or discus
Hey everyone, just wanted to say a huge thanks to all of you who helped with this version — whether through contributions, reporting issues, or discussions. I've been very busy lately, and your support has been a huge help. I really appreciate it!
MatchVersion(Predicate<Version>) (#1231) @0xcedlatestPatch to latestMinor (#1230) @0xcedThank you to everyone whose contributions made this release possible.
Thank you to everyone whose contributions made this release possible.
The UntilOperationIsSucceeded(Func<bool>, int, Action<IWaitStrategy>) wait strategy is obsolete. Instead of this wait strategy, use any other wait strategy that matches your use case and configure the retry behavior accordingly (wait strategy options).
Using reuse together with the container builder method WithName(string) will generate a new reuse hash the first time you use the configuration. The container name was not included in calculating the reuse hash previously.
/var/lib/mysql-files directory to prevent older versions from failing to start (#1144) @0xcedThank you very much to all contributors once again. This version contains really great features and important fixes. Awesome increment 🙏.
Thank you very much to all contributors once again. This version contains really great features and important fixes. Awesome increment 🙏.
If you have overwritten the default logger previously (setting TestcontainersSettings.Logger), please be aware that each builder now offers a dedicated API to configure the actual logger. This has several advantages; among others, it integrates very nicely into xUnit.net's scoped loggers.
WithLogger(ILogger) builder API (#1100) @0xcedWithLogger(ILogger) builder API (#1100) @0xcedNullReferenceException when pulling uncached base images to build an image (#1126) @tom-englertpg_isready command to assess whether PostgreSQL is ready or not (#1111) @0xcedHappy New Year and a massive thank you to all the contributors who made the new version of Testcontainers for .NET possible 🙌!
Happy New Year and a massive thank you to all the contributors who made the new version of Testcontainers for .NET possible 🙌!
A heartfelt thank you to each contributor. Your contributions, whether through sharing ideas for improvements, identifying issues, submitting pull req
A heartfelt thank you to each contributor. Your contributions, whether through sharing ideas for improvements, identifying issues, submitting pull requests, or writing articles, are immensely appreciated and help me a lot. THANK YOU for your support.
The members of the container and image builder, WithImagePullPolicy and WithImageBuildPolicy, previously received a callback argument of type ImagesListResponse. We've now updated these callbacks, and they will receive an argument of type ImageInspectResponse. This change was implemented to offer more detailed information regarding the actual cached image.
feat: Allow MongoDb module configuration without credentials (#983) @the-avid-engineer
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT env var (#971) @eddumelendezThank you to all contributors for your valuable efforts towards this release. Your contributions are greatly appreciated ❤️.
Thank you to all contributors for your valuable efforts towards this release. Your contributions are greatly appreciated ❤️.
feat: Add support for copying directories and files to a container (#913) @HofmeisterAn
feat: Add TC host strategy (#885) @HofmeisterAn
As mentioned in the two previous releases, we replaced the legacy extension method modules with a dedicated API. We recommend moving forward to the ne
We have added and replaced the modules mentioned below. Each module contains its own builder and configuration type, making it much easier to support
We have added and replaced the modules mentioned below. Each module contains its own builder and configuration type, making it much easier to support various test cases. Currently, the modules are designed to quickly spin up common configurations of real dependencies to establish a connection to the application or service running inside it.
We are interested in your opinions and requirements in regards of the module's capabilities. Creating great modules is a community effort, so please consider sharing your thoughts with us and other Testcontainers users in this discussion or in our Slack workspace.
We will continuously add module features and documentation. Currently, information on how to configure and run modules can be found in the tests. If you are already familiar with Testcontainers, you should have no trouble understanding it as the experience is very similar as before. Here is a quick example using xUnit.net:
public sealed class ModuleSupport : IAsyncLifetime
{
private readonly MsSqlContainer _msSqlContainer = new MsSqlBuilder().Build();
public Task InitializeAsync()
{
return _msSqlContainer.StartAsync();
}
public Task DisposeAsync()
{
return _msSqlContainer.DisposeAsync().AsTask();
}
[Fact]
public void ConnectionStateReturnsOpen()
{
// Given
using DbConnection connection = new SqlConnection(_msSqlContainer.GetConnectionString());
// When
connection.Open();
// Then
Assert.Equal(ConnectionState.Open, connection.State);
}
}
| Old name | New name |
|---|---|
ITestcontainersContainer, IDockerContainer, IRunningDockerContainer |
IContainer |
IDockerImage |
IImage |
IDockerNetwork |
INetwork |
IDockerVolume |
IVolume |
TestcontainersBuilder |
ContainerBuilder |
TestcontainersContainer |
DockerContainer |
TestcontainersNetworkBuilder |
NetworkBuilder |
TestcontainersVolumeBuilder |
VolumeBuilder |
WithCreateContainerParametersModifier |
WithCreateParameterModifier |
IContainer.GetLogsAsync(DateTime, DateTime, bool, CancellationToken) (#793) @HofmeisterAnOne column per quarter.