Skip to content

feat: add Podman compatibility (parity with testcontainers-go and testcontainers-java) #1027

@Tranquility2

Description

@Tranquility2

Problem

Testcontainers for Python currently assumes the configured container runtime is Docker. Running tests against a Podman daemon works partially but breaks in a few places:

  1. DockerCompose shells out to docker compose, which fails on a pure-Podman host without the podman-docker shim package installed.
  2. bind_ports parsing trips over Podman's protocol-suffixed published port format (e.g. "8080/tcp" vs Docker's "8080").
  3. Host port ranges in compose files (published: "5000-5999") silently break tests because Podman doesn't support them.
  4. There is no way to programmatically tell whether the connected daemon is Podman, so adaptive behavior is impossible.

Other Testcontainers implementations already ship first-class Podman support:

Proposal

Bring Testcontainers for Python to feature parity with go/java for Podman: detect the runtime at the daemon level, transparently adapt the few code paths that differ (compose binary, port-binding parsing), keep the existing Docker behavior unchanged when Docker is in use, and document the supported setup alongside Docker.

Note: A PR implementing this will be opened shortly.

Metadata

Metadata

Assignees

No fields configured for Enhancement.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions