TestcontainerEx (testcontainer_ex v0.1.0)

Copy Markdown View Source

Public API for TestcontainerEx.

This module is a thin facade that delegates to the GenServer (TestcontainerEx.Server) and domain modules.

Summary

Functions

connected?(name \\ __MODULE__)

container_engine()

create_network(network_name, name \\ __MODULE__)

get_host()

get_host(container)

get_host(container, name)

get_port(container, port)

get_port(container, port, name)

parse_gateway_from_proc_route(content)

Parses the default gateway IP from /proc/net/route content.

Returns {:ok, ip_string} or {:error, :no_default_route}.

remove_network(network_name, name \\ __MODULE__)

running_in_container?()

running_in_container?(dockerenv_path, cgroup_path, k8s_secrets_path \\ "/var/run/secrets/kubernetes.io", containerenv_path \\ "/.containerenv")

Returns true when running inside a container (Docker, Podman, Kubernetes).

Accepts optional overrides for the .dockerenv path, cgroup path, Kubernetes secrets path, and Podman containerenv path (useful for testing on non-Linux hosts).

ryuk_privileged?(properties)

See TestcontainerEx.Ryuk.privileged?/1.

start(options \\ [])

start_compose(config, name \\ __MODULE__)

start_container(config_builder, name \\ __MODULE__)

start_link(options \\ [])

stop(name \\ __MODULE__)

stop_compose(compose_env, name \\ __MODULE__)

stop_container(container_id, name \\ __MODULE__)