class

Docr::Endpoints::Containers

Inherits Reference / Object

Class responsible for handling container operations in the Docr system.

Constructors

new(client : Docr::Client)

Initializes a new Containers instance with the provided client.

Source

Instance methods

attach(id : String)

Attach to a container

  • id: ID of the container to attach to.
Source

Fetches the changes made to the container.

  • id: ID of the container.

Returns an array of container change items.

Source
client
Source

Creates a new container.

  • name: Name of the container.
  • config: Configuration for creating the container.

Returns a response containing information about the created container.

Source

Inspects a specific container.

  • id: ID of the container to inspect.

Returns detailed information about the container.

Source
kill(id : String, signal = "SIGKILL")

Kills a specific container.

  • id: ID of the container to kill.
  • signal: Signal to use for killing. Default is "SIGKILL".
Source
list(all : Bool = false, limit : Int32 | Nil = nil, size : Bool = false, filters = Hash(String, Array(String)).new) : Array(Docr::Types::ContainerSummary)

Fetches a list of containers.

  • all: If true, list all containers. Default is false.
  • limit: The maximum number of containers to list.
  • size: If true, fetch container sizes. Default is false.
  • filters: Container filter criteria. Default is an empty hash.

Returns an array of container summaries.

Source
logs(id : String, follow = false, stdout = false, stderr = false, since = 0, _until = 0, timestamps = false, tail = "all")

Fetches logs of a specific container.

  • id: ID of the container.
  • follow: If true, follow logs. Default is false.
  • stdout: If true, fetch stdout logs. Default is false.
  • stderr: If true, fetch stderr logs. Default is false.
  • since: Timestamp to start showing logs. Default is 0.
  • until: Timestamp to stop showing logs. Default is 0.
  • timestamps: If true, include timestamps. Default is false.
  • tail: Number of lines to show from the end of the logs. Default is "all".

Returns the IO stream of the logs.

Source
pause(id : String)

Pauses a specific container.

  • id: ID of the container to pause.
Source
restart(id : String)

Restarts a specific container.

  • id: ID of the container to restart.
Source
start(id : String)

Starts a specific container.

  • id: ID of the container to start.
Source
stop(id : String)

Stops a specific container.

  • id: ID of the container to stop.
Source
top(id : String, ps_args = "-ef") : Docr::Types::ContainerTopResponse

Fetches process details within a specific container.

  • id: ID of the container.
  • ps_args: Arguments for the ps command. Default is "-ef".

Returns process details within the container.

Source
unpause(id : String)

Unpauses a specific container.

  • id: ID of the container to unpause.
Source
wait(id : String, condition = "not-running") : Docr::Types::ContainerWaitResponse

Waits for a container to reach a specific condition.

  • id: ID of the container to wait for.
  • condition: Wait condition. Default is "not-running".

Returns information about the waited container.

Source