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/features/garbage_collector.md
+41
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,47 @@ The primary method is to use the `Terminate(context.Context)` function that is
17
17
available when a container is created. Use `defer` to ensure that it is called
18
18
on test completion.
19
19
20
+
The `Terminate` function can be customised with termination options to determine how a container is removed: termination timeout, and the ability to remove container volumes are supported at the moment. You can build the default options using the `testcontainers.NewTerminationOptions` function.
21
+
22
+
#### NewTerminateOptions
23
+
24
+
- Not available until the next release of testcontainers-go <ahref="https://github.com/testcontainers/testcontainers-go"><spanclass="tc-version">:material-tag: main</span></a>
25
+
26
+
If you want to attach option to container termination, you can use the `testcontainers.NewTerminateOptions(ctx context.Context, opts ...TerminateOption) *TerminateOptions` option, which receives a TerminateOption as parameter, creating custom termination options to be passed on the container termination.
0 commit comments