You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/connection_string_provider.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
The Connection String Provider API provides a standardized way to access and manage connection information for Testcontainers (modules). It allows developers to customize module-provided connection strings or add their own, and to access module-specific connection strings or endpoints (e.g., database connection strings, HTTP API base addresses) in a uniform way.
4
4
5
-
!!!note
5
+
!!!note
6
6
7
7
Testcontainers modules do not yet implement this feature. Developers can use the provider to define and manage their own connection strings or endpoints. Providers will be integrated by modules in future releases.
A specifier has the format `<os>|<arch>|<os>/<arch>[/<variant>]`. The user can provide either the operating system or the architecture or both. For more details, see [containerd/platforms](https://github.com/containerd/platforms).
28
28
@@ -42,7 +42,7 @@ _ = new ContainerBuilder("nginx:1.26.3-alpine3.20")
42
42
43
43
Apps or services running inside a container are usually configured either with environment variables or configuration files. `WithEnvironment(string, string)` sets an environment variable, while `WithResourceMapping(string, string)` copies a file into a container before it starts. This covers common use cases among many .NET applications.
44
44
45
-
!!!tip
45
+
!!!tip
46
46
47
47
The majority of builder methods are overloaded and have different parameters to set configurations.
48
48
@@ -177,7 +177,7 @@ var postgreSqlContainer = new PostgreSqlBuilder("postgres:15.1")
177
177
178
178
Using `OverwriteEnumerable<string>(Array.Empty<string>())` removes all default command configurations. This is useful when you want full control over the PostgreSQL startup or when the default configurations do not match your requirements.
179
179
180
-
!!!tip
180
+
!!!tip
181
181
182
182
You can create your own `ComposableEnumerable<T>` implementation to control exactly how configuration values are composed or modified.
183
183
@@ -232,7 +232,7 @@ var magicNumber = await magicNumberReader.ReadLineAsync()
232
232
Assert.Equal(MagicNumber, magicNumber);
233
233
```
234
234
235
-
!!!tip
235
+
!!!tip
236
236
237
237
To avoid port conflicts, do not bind a fix host port. Instead, assign a random host port by using `WithPortBinding(80, true)` and retrieve it from the container instance by using `GetMappedPublicPort(80)`.
Copy file name to clipboardExpand all lines: docs/api/create_docker_image.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ To build a Docker image with Testcontainers, it's important to understand the bu
22
22
2.**Dockerfile name**: The name of the Dockerfile to use
23
23
3.**Dockerfile directory**: Where the Dockerfile is located
24
24
25
-
!!!tip
25
+
!!!tip
26
26
27
27
The build context is optional. If you don't specify one, it defaults to the Dockerfile directory.
28
28
@@ -56,7 +56,7 @@ _ = new ImageFromDockerfileBuilder()
56
56
57
57
As the tarball's content is based on `/Users/testcontainers/WeatherForecast/`, all paths inside the Dockerfile must be relative to this path. For example, Docker's `COPY` instruction copies all files inside the `WeatherForecast/` directory to the image.
58
58
59
-
!!!tip
59
+
!!!tip
60
60
61
61
To improve the build time and to reduce the size of the image, it is recommended to include only necessary files. Exclude unnecessary files or directories such as `bin/`, `obj/` and `tests/` with the `.dockerignore` file.
62
62
@@ -119,7 +119,7 @@ _ = new ImageFromDockerfileBuilder()
Copy file name to clipboardExpand all lines: docs/api/resource_reaper.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
Testcontainers automatically assigns a Resource Reaper session id to each Docker resource. After the tests are finished — whether they are successful or not — [Moby Ryuk](https://github.com/testcontainers/moby-ryuk) will take care of the remaining Docker resources and removes them. You can change the Resource Reaper session and group Docker resources together. Right now, only Linux containers are supported.
4
4
5
-
!!!tip
5
+
!!!tip
6
6
7
7
Whenever possible, do **not** disable the Resource Reaper. It keeps your machine and CI/CD environment clean. If at all, consider disabling the Resource Reaper only for environments that have a mechanism to cleanup Docker resources, e.g. ephemeral CI nodes.
8
8
@@ -23,6 +23,6 @@ await new ContainerBuilder("alpine:3.20.0")
23
23
.ConfigureAwait(false);
24
24
```
25
25
26
-
!!!warning
26
+
!!!warning
27
27
28
28
Testcontainers for .NET assigns a default session id. You do not have to override the Resource Reaper session id usually. -->
Copy file name to clipboardExpand all lines: docs/api/resource_reuse.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ _ = new ContainerBuilder("alpine:3.20.0")
17
17
18
18
The current implementation considers the following resource configurations and their corresponding builder APIs when calculating the hash value.
19
19
20
-
!!!note
20
+
!!!note
21
21
22
22
Version 3.8.0 did not include the container configuration's name in the hash value.
23
23
@@ -41,7 +41,7 @@ The current implementation considers the following resource configurations and t
41
41
42
42
By default, all module resource configurations are included. This works well for simple value and reference types that can be serialized and deserialized to JSON without custom converters. However, more complex resource configurations may require a custom converter to properly serialize and deserialize their values.
43
43
44
-
!!!warning
44
+
!!!warning
45
45
46
46
Reuse does not replace singleton implementations to improve test performance. Prefer proper shared instances according to your chosen test framework.
Copy file name to clipboardExpand all lines: docs/api/wait_strategies.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ _ = Wait.ForUnixContainer()
74
74
.UntilInternalTcpPortIsAvailable(8080);
75
75
```
76
76
77
-
!!!note
77
+
!!!note
78
78
79
79
Just because a service is listening on the internal TCP port does not necessarily mean it is fully ready to handle requests. Often, wait strategies such as checking for specific log messages or verifying a health endpoint provide more reliable confirmation that the service is operational.
80
80
@@ -87,7 +87,7 @@ _ = Wait.ForUnixContainer()
87
87
.UntilExternalTcpPortIsAvailable(8080);
88
88
```
89
89
90
-
!!!note
90
+
!!!note
91
91
92
92
External TCP port availability doesn't guarantee that the actual service inside the container is ready to handle requests. It only confirms that the port mapping is established and a connection can be made to the host-side proxy.
These log messages are from the Testcontainers library and contain information about the test resources. They do not include log messages from the containers. To get the container log messages, see: [Getting log messages](https://dotnet.testcontainers.org/api/create_docker_container/#getting-log-messages).
For the complete source code of this example and additional information, please refer to our [test projects](https://github.com/testcontainers/testcontainers-dotnet/tree/develop/tests).
[Garnet](https://github.com/microsoft/garnet) is a high-performance, Redis-compatible in-memory data store.
4
+
5
+
The Testcontainers Redis module is compatible with the Garnet container image. You can use the existing [`Testcontainers.Redis`](/modules/redis/) package without requiring a separate Garnet module.
6
+
7
+
!!! note
8
+
9
+
If Garnet introduces features or configuration options that require dedicated support in the future, we can introduce a separate module at that time.
| MySQL |`mysql:8.0`|[NuGet](https://www.nuget.org/packages/Testcontainers.MySql)|[Source](https://github.com/testcontainers/testcontainers-dotnet/tree/develop/src/Testcontainers.MySql)|
| SQL Server |`mcr.microsoft.com/mssql/server:2022-CU14-ubuntu-22.04`|[NuGet](https://www.nuget.org/packages/Testcontainers.MsSql)|[Source](https://github.com/testcontainers/testcontainers-dotnet/tree/develop/src/Testcontainers.MsSql)|
0 commit comments