View Source DockerEngineAPI.Api.Exec (testcontainers v1.11.6)

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

Link to this function

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

View Source

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
Link to this function

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

View Source

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
Link to this function

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

View Source
@spec exec_resize(Tesla.Env.client(), String.t(), 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
  • opts (keyword): Optional parameters
    • :h (integer()): Height of the TTY session in characters
    • :w (integer()): Width of the TTY session in characters

Returns

  • {:ok, nil} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

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

View Source
@spec exec_start(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, Tesla.Env.t() | 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