class Docker::Container

Overview

Interact with a single container that exists on a docker client.

Included Modules

Defined in:

docker/container.cr

Constructors

Instance Method Summary

Constructor methods inherited from module Docker::ApiClientWrapper

new(client) new

Constructor Detail

def self.new(client : Docker::Api::ApiClient, id : String) #

Create a new container interaction object for the passed container id.


[View source]
def self.new(client : Docker::Api::ApiClient, attrs : Docker::Api::Models::Container) #

Create a new container interaction object based on a previous queried container model.


[View source]

Instance Method Detail

Locally cached container attributes.

This is populated at the time of object creation. Use '#reload!' to update.


[View source]
def id #

The ID of the container object.


[View source]
def image #

The image ID of the container.


[View source]
def kill(signal = nil) #

Kill or send a signal to the container.


[View source]
def labels #

The labels of a container.


[View source]
def name #

The name of the container.


[View source]
def pause #

Pauses all processes within this container.


[View source]
def reload! #

Load this object from the server again and update attrs with the new data.


[View source]
def remove(v = nil, force = nil, link = nil) #

Remove this container.

Similar to the docker rm command.


[View source]
def rename(name : String) #

Rename this container.

Similar to the docker rename command.


[View source]
def restart(timeout = nil) #

Restart this container.

Similar to the docker restart command.


[View source]
def short_id #

The ID of the object, truncated to 10 characters.


[View source]
def start #

Start this container.


[View source]
def status #

The status of the container. For example, "running", or "exited".


[View source]
def stop(timeout = nil) #

Stop this container.


[View source]
def unpause #

Unpause all processes within the container.


[View source]
def update(**props) #

Update resource configuration of the containers.


[View source]
def wait(condition = nil) #

Block until the container stops, then return its exit code.


[View source]