class Companion::Docker::Client::Local

Included Modules

Defined in:

docker/client/client.cr

Constructors

Instance Method Summary

Instance methods inherited from module Companion::Docker::Client

create_container(options : CreateContainerOptions, name : String) : CreateContainerResponse create_container, create_network(options : CreateNetworkOptions) : CreateNetworkResponse create_network, get_container_id(name : String) : String | Nil get_container_id, get_logs(id : String, stdout : Bool, stderr : Bool, lines : Int32) : String get_logs, images : Array(Image) images, pull_image(name, &block : CreateImageResponse -> ) pull_image, start_container(id : String) : Nil start_container

Constructor Detail

def self.new(config : Companion::Docker::Client::Local::Config = Config.new) #

[View source]

Instance Method Detail

def connect_network(options : ConnectNetworkOptions) : Nil #

Connect a container to a network


[View source]
def containers(all = false) : Array(Container) #

Lists containers.

By default list only running ones. Set all to true to get all containers.


[View source]
def create_container(options : CreateContainerOptions, name : String | Nil = nil) : CreateContainerResponse #

Creates a new container and return its id.


[View source]
def create_image(from_image : String, tag : String, &) #

Create an image and returns its id


[View source]
def create_network(options : CreateNetworkOptions) : CreateNetworkResponse #
Description copied from module Companion::Docker::Client

Creates a network.


[View source]
def get_container_id(name : String) : String | Nil #
Description copied from module Companion::Docker::Client

Get a container's id.

Returns nil if the container is not found.


[View source]
def get_logs(id : String, stdout : Bool, stderr : Bool, lines : Int32) : String #
Description copied from module Companion::Docker::Client

Get a container's logs


[View source]
def images : Array(Image) #
Description copied from module Companion::Docker::Client

Get images.


[View source]
def networks : Array(Network) #

[View source]
def pull_image(name, tag = "latest", &block : CreateImageResponse -> ) #

Pulls an image from dockerhub


[View source]
def remove_container(id : String) : Nil #

Removes a containers.

If the container is running, it will be killed.


[View source]
def start_container(id : String) : Nil #

Starts a container.


[View source]