Configuration for the Docker CLI wrapper.
Holds the path to the Docker binary, working directory, environment variables, and timeout settings used when executing Docker commands.
Summary
Functions
Returns base arguments prepended to all Docker commands.
Builds the options keyword list for System.cmd/3.
Finds the Docker-compatible binary on the system.
Creates a new Docker.Config struct.
Types
@type t() :: %Docker.Config{ binary: String.t(), env: [{String.t(), String.t()}], timeout: pos_integer(), working_dir: String.t() | nil }
Functions
Returns base arguments prepended to all Docker commands.
Builds the options keyword list for System.cmd/3.
@spec find_binary() :: String.t()
Finds the Docker-compatible binary on the system.
Checks the DOCKER_PATH environment variable first, then searches
for docker, podman, or nerdctl on the PATH.
Raises if no binary is found.
Creates a new Docker.Config struct.
Options
:binary- path to the Docker executable (default: auto-detected):working_dir- working directory for commands (default:nil, uses current directory):env- list of{key, value}tuples for environment variables (default:[]):timeout- command timeout in milliseconds (default:30000)
Examples
iex> config = Docker.Config.new()
iex> config.binary != nil
true
iex> config = Docker.Config.new(timeout: 60_000)
iex> config.timeout
60_000