Docker / Podman container lifecycle management.
Detects the available container runtime (Docker or Podman) and provides a unified interface for container and compose operations.
All command execution is routed through Trebejo.SafeCommand.execute/3
with arg lists — never interpolated into shell strings — to prevent
shell injection. Runtime is auto-detected via
Apero.Proc.command_exists?/1; environment variable CONTAINER_RUNTIME
(docker | podman) overrides the detection.
Summary
Functions
Builds images.
Stops and removes services.
Executes a command in a compose service container.
Shows logs for compose services.
Lists running compose services.
Pulls images for compose services.
Restarts services.
Starts services defined in docker-compose.yml.
Executes a command inside a running container.
Returns true if running inside a container.
Creates a network.
Lists networks.
Removes a network.
Lists running containers.
Pulls a Docker image.
Removes a container.
Creates and starts a new container.
Detects the available container runtime.
Returns the runtime binary name as a string.
Starts an existing container.
Returns the state of a container.
Stops a running container.
Creates a volume.
Lists volumes.
Removes a volume.
Types
Functions
Builds images.
Stops and removes services.
Executes a command in a compose service container.
Shows logs for compose services.
Lists running compose services.
Pulls images for compose services.
Restarts services.
Starts services defined in docker-compose.yml.
@spec exec(container_name(), [String.t()], keyword()) :: {:ok, String.t()} | {:error, String.t()}
Executes a command inside a running container.
@spec in_container?() :: boolean()
Returns true if running inside a container.
Creates a network.
Lists networks.
Removes a network.
Lists running containers.
Pulls a Docker image.
@spec rm( container_name(), keyword() ) :: :ok | {:error, String.t()}
Removes a container.
@spec run(keyword()) :: {:ok, container_name()} | {:error, String.t()}
Creates and starts a new container.
@spec runtime() :: runtime() | :none
Detects the available container runtime.
@spec runtime_binary() :: String.t()
Returns the runtime binary name as a string.
@spec start(container_name()) :: :ok | {:error, String.t()}
Starts an existing container.
@spec state(container_name()) :: :running | :stopped | :missing | {:error, String.t()}
Returns the state of a container.
@spec stop(container_name(), pos_integer()) :: :ok | {:error, String.t()}
Stops a running container.
Creates a volume.
Lists volumes.
Removes a volume.