DockerEngineAPI.Api.Exec (ex_docker_api v1.48.1)

View Source

API calls for all endpoints tagged Exec.

Summary

Functions

Create an exec instance Run a command inside a running container.

Inspect an exec instance Return low-level information about an exec instance.

Resize an exec instance Resize the TTY session used by an exec instance. This endpoint only works if tty was specified as part of creating and starting the exec instance.

Start an exec instance Starts a previously set up exec instance. If detach is true, this endpoint returns immediately after starting the command. Otherwise, it sets up an interactive session with the command.

Functions

container_exec(connection, id, exec_config, opts \\ [])

Create an exec instance Run a command inside a running container.

Parameters

  • connection (DockerEngineAPI.Connection): Connection to server
  • id (String.t): ID or name of container
  • exec_config (ExecConfig): Exec configuration
  • opts (keyword): Optional parameters

Returns

  • {:ok, DockerEngineAPI.Model.IdResponse.t} on success
  • {:error, Tesla.Env.t} on failure

exec_inspect(connection, id, opts \\ [])

Inspect an exec instance Return low-level information about an exec instance.

Parameters

  • connection (DockerEngineAPI.Connection): Connection to server
  • id (String.t): Exec instance ID
  • opts (keyword): Optional parameters

Returns

  • {:ok, DockerEngineAPI.Model.ExecInspectResponse.t} on success
  • {:error, Tesla.Env.t} on failure

exec_resize(connection, id, h, w, opts \\ [])

@spec exec_resize(Tesla.Env.client(), String.t(), integer(), integer(), keyword()) ::
  {:ok, nil}
  | {:ok, DockerEngineAPI.Model.ErrorResponse.t()}
  | {:error, Tesla.Env.t()}

Resize an exec instance Resize the TTY session used by an exec instance. This endpoint only works if tty was specified as part of creating and starting the exec instance.

Parameters

  • connection (DockerEngineAPI.Connection): Connection to server
  • id (String.t): Exec instance ID
  • h (integer()): Height of the TTY session in characters
  • w (integer()): Width of the TTY session in characters
  • opts (keyword): Optional parameters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure

exec_start(connection, id, opts \\ [])

@spec exec_start(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, nil}
  | {:ok, DockerEngineAPI.Model.ErrorResponse.t()}
  | {:error, Tesla.Env.t()}

Start an exec instance Starts a previously set up exec instance. If detach is true, this endpoint returns immediately after starting the command. Otherwise, it sets up an interactive session with the command.

Parameters

  • connection (DockerEngineAPI.Connection): Connection to server
  • id (String.t): Exec instance ID
  • opts (keyword): Optional parameters
    • :body (ExecStartConfig):

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure