TestcontainerEx.Engine (testcontainer_ex v0.6.0)

Copy Markdown View Source

Detects which container engine is in use: Docker, Podman, minikube, or Apple Container.

Detection is cached after the first call via :persistent_term.

Precedence

  1. CONTAINER_ENGINE env var — explicit selection (docker, podman, colima, minikube, apple_container). When set, auto-detection is skipped entirely.
  2. CONTAINER_ENGINE_HOST / CONTAINER_HOST env vars — if the URL contains podman or matches minikube subnets, the engine is inferred from the URL.
  3. MINIKUBE_ACTIVE_DOCKERD / MINIKUBE_PROFILE env vars.
  4. Apple Container — only when the container binary exists, the service reports "running", and the API socket exists.
  5. Podman ping — HTTP ping to the daemon checking for a Podman header.
  6. Default — :docker.

Summary

Functions

Returns true when running with Apple Container.

Detects the container engine type.

Returns true when running in a minikube environment.

Returns true when running with Podman.

Functions

apple_container?()

@spec apple_container?() :: boolean()

Returns true when running with Apple Container.

detect()

@spec detect() :: :docker | :podman | :minikube | :apple_container

Detects the container engine type.

Returns one of:

  • :apple_container — Apple Container runtime
  • :podman — Podman
  • :minikube — Minikube
  • :docker — Docker (default)

Results are cached after the first call.

minikube?()

@spec minikube?() :: boolean()

Returns true when running in a minikube environment.

podman?()

@spec podman?() :: boolean()

Returns true when running with Podman.