Orchestrates container lifecycle: create, start, wait, pull, copy.
This module is the bridge between the GenServer state and the Docker API.
All functions require a connection and return {:ok, container} or {:error, reason}.
Summary
Functions
@spec start_container(struct(), Tesla.Env.client(), map()) :: {:ok, TestcontainerEx.Container.Config.t()} | {:error, term()}
Creates and starts a container, applying wait strategies.
Steps:
- Build config with labels (via BuilderHelper)
- Check for reusable container or create new one
- Pull image if needed
- Copy files into container
- Start container
- Apply wait strategies
- Call after_start hook
@spec stop_container(String.t(), Tesla.Env.client()) :: :ok | {:error, term()}
Stops a container by ID.