module Docker::Api::Containers

Overview

API queries for container interaction.

Direct including types

Defined in:

docker/api/containers.cr

Instance Method Summary

Instance Method Detail

def containers(all : Bool | Nil = nil, limit : Int | Nil = nil, size : Bool | Nil = nil, filters : Hash | Nil = nil) #

List containers.

Similar to the docker ps command.


[View source]
def create_container(name : String | Nil = nil, **props) #

Creates a container.

Parameters are similar to those for the docker run command.


[View source]
def inspect_container(id : String) #

Query container info.

Identical to the docker inspect command, but only for containers.


[View source]
def kill(id : String, signal : String | Nil = nil) #

Send a POSIX signal to a container, defaulting to killing to the container.

Similar to the docker kill command.


[View source]
def pause(id : String) #

Pauses all processes within a container.

Similar to docker pause command.


[View source]
def remove_container(id : String, v : Bool | Nil = nil, force : Bool | Nil = nil, link : Bool | Nil = nil) #

Remove a container.

Similar to the docker rm command.


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

Rename a container.

Similar to the docker rename command.


[View source]
def restart(id : String, timeout : Int | Nil = nil) #

Restart a container.

Similar to the docker restart command.


[View source]
def start(id : String) #

Start a container.

Similar to the docker start command, but doesn’t support attach options.


[View source]
def stop(id : String, timeout : Int | Nil = nil) #

Stops a container.

Similar to the docker stop command.


[View source]
def unpause(id : String) #

Resume a container which has been paused.

Similar to docker unpause command.


[View source]
def update(id : String, **props) #

Change various configuration options of a container without having to recreate it.

Similar to docker update command.


[View source]
def wait(id : String, condition : String | Nil = nil) #

Block until a container stops, then returns the exit code.

Similar to docker wait command.


[View source]