Skip to content

Commit

Permalink
docs: Add version pinning is a best practice
Browse files Browse the repository at this point in the history
  • Loading branch information
HofmeisterAn committed Jun 4, 2024
1 parent 4a512ef commit 66bb577
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/api/best_practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ At times, configuring and launching disposable Docker resources for testing purp
5. Avoid mounting local host paths to containers. Instead, use `_container.WithResourceMapping(string, string)` or one of its overloaded members to copy dependent files to the container before it starts.
6. In rare cases, it may be necessary to access the underlying Docker API to configure specific properties that are not exposed by Testcontainers' own API. To get access to all Docker API properties required to create a resource, use `_builder.WithCreateParameterModifier(Action<TCreateResourceEntity>)`.
7. Do not disable the Resource Reaper, as it cleans up remaining test resources. Disabling it may clutter up the test environment.
8. Ensure that the image version is overridden and pinned, regardless of whether you are using the generic or module container builder `_builder.WithImage("alpine:3.20.0")`.

0 comments on commit 66bb577

Please sign in to comment.