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
Brings _Testcontainers for Python_ to feature parity with
[testcontainers-go](https://golang.testcontainers.org/system_requirements/using_podman/)
and
[testcontainers-java](https://java.testcontainers.org/supported_docker_environment/#podman)
for Podman:
- Detect the runtime at the daemon level (cached).
- Transparently adapt the code paths that differ between Docker and
Podman (compose binary selection, port-binding parsing).
- Keep existing Docker behavior unchanged when Docker is the active
runtime.
- Document the supported setup alongside Docker.
Closes#1027.
---------
Co-authored-by: David Ankin <daveankin@gmail.com>
Testcontainers requires a Docker-API compatible container runtime.
4
6
During development, Testcontainers is actively tested against recent versions of Docker on Linux, as well as against Docker Desktop on Mac and Windows.
5
7
These Docker environments are automatically detected and used by Testcontainers without any additional configuration being necessary.
6
8
7
-
It is possible to configure Testcontainers to work for other Docker setups, such as a remote Docker host or Docker alternatives.
8
-
However, these are not actively tested in the main development workflow, so not all Testcontainers features might be available and additional manual configuration might be necessary. Please see the [Docker host detection](../features/configuration.md#docker-host-detection) section for more information.
9
+
It is possible to configure Testcontainers to work with alternative container runtimes (see further down for specific runtimes, or [Docker host detection](../features/configuration.md#docker-host-detection) for general configuration mechanisms).
10
+
Alternative container runtimes are not actively tested in the main development workflow, so not all Testcontainers features might be available and additional manual configuration might be necessary.
9
11
10
12
If you have further questions about configuration details for your setup or whether it supports running Testcontainers-based tests,
11
13
please contact the Testcontainers team and other users from the Testcontainers community on [Slack](https://slack.testcontainers.org/).
14
+
15
+
## Podman
16
+
17
+
In order to run testcontainers against [Podman](https://podman.io/), the env var below should be set.
18
+
19
+
Testcontainers auto-detects Podman from the daemon's `version` response and adapts a few behaviors (compose binary selection, port-binding parsing) accordingly.
You can also persist this in `~/.testcontainers.properties` as `docker.host=...`, or use a Docker context (`docker context use my-podman`).
42
+
43
+
### Docker Compose with Podman
44
+
45
+
`DockerCompose` prefers `docker` if it is on `PATH` (e.g. via the `podman-docker` shim). Otherwise, when Podman is detected, it falls back to the `podman` binary. You can always override the binary explicitly:
46
+
47
+
```python
48
+
DockerCompose(".", docker_command_path="podman")
49
+
```
50
+
51
+
Note that Podman does not support host port ranges (`published: "5000-5999"`) in compose files.
Copy file name to clipboardExpand all lines: docs/system_requirements/index.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
@@ -180,4 +180,4 @@ commands = pytest
180
180
181
181
With any of these, once your environment is set up you can simply `pip install testcontainers` (or use Poetry’s `poetry add --dev testcontainers`) and begin writing your container-backed tests in Python.
182
182
183
-
See the [General Docker Requirements](docker.md) to continue
183
+
See [Supported Docker environments](docker.md) to continue
0 commit comments