Docker network operations.
Summary
Functions
Inspects the default bridge network and returns its gateway IP. Used for Docker-outside-of-Docker (DooD) detection.
Creates a Docker network. Returns {:ok, id} or {:ok, :already_exists}.
Checks if a network exists.
Removes a Docker network.
Functions
@spec bridge_gateway(Tesla.Env.client()) :: {:ok, String.t()} | {:error, term()}
Inspects the default bridge network and returns its gateway IP. Used for Docker-outside-of-Docker (DooD) detection.
@spec create(String.t(), Tesla.Env.client()) :: {:ok, String.t()} | {:ok, :already_exists} | {:error, term()}
Creates a Docker network. Returns {:ok, id} or {:ok, :already_exists}.
@spec exists?(String.t(), Tesla.Env.client()) :: boolean()
Checks if a network exists.
@spec remove(String.t(), Tesla.Env.client()) :: :ok | {:error, term()}
Removes a Docker network.