Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add low level API access #1300

Merged
merged 2 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ name: Continuous Integration & Delivery
on:
push:
branches: [ develop, main, bugfix/*, feature/* ]
paths-ignore: [ 'docs/**', 'examples/**' ]
pull_request:
branches: [ develop, main ]
paths-ignore: [ 'docs/**', 'examples/**' ]
workflow_dispatch:
inputs:
publish_nuget_package:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ name: CodeQL
on:
push:
branches: [ develop, main ]
paths-ignore: [ 'docs/**', 'examples/**' ]
pull_request:
branches: [ develop, main ]
paths-ignore: [ 'docs/**', 'examples/**' ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.sha }}
Expand Down
9 changes: 9 additions & 0 deletions docs/api/low_level_api_access.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Low level API access

Testcontainers does not expose all available [Docker Engine APIs](https://docs.docker.com/reference/api/engine/latest/) through its container, image, network, and volume builders. In some cases, you may need to access the underlying Docker Engine API to configure specific properties that are not available via Testcontainers' API. To access all available Docker Engine API properties for creating a resource, use the builder method: `WithCreateParameterModifier(Action<TCreateResourceEntity>)`. This method allows you to use a callback to configure the final payload that is sent to the Docker Engine.

```csharp title="Setting the memory limit to 2GB"
const long TwoGB = 2L * 1024 * 1024 * 1024;
_ = new ContainerBuilder()
.WithCreateParameterModifier(parameterModifier => parameterModifier.HostConfig.Memory = TwoGB);
```
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ nav:
- api/create_docker_image.md
- api/create_docker_container.md
- api/create_docker_network.md
- api/low_level_api_access.md
- api/resource_reaper.md
- api/resource_reuse.md
- api/wait_strategies.md
Expand Down