[][src]Module dockers::containers

Containers is the main structure for handling containers

You can create an empty container or you can pass the ID of an existing one or an Image name to create a new one.

Example

extern crate dockers;

use dockers::Container;
use dockers::Image;

let image = Image::pull("node".to_owned(), None)
    .expect("Image not pulled");

// Create a container struct from an image and then create the actual container.
let cont = Container::new(None, Some("node".to_owned()));
let cont = cont.create(None, None).expect("Couldn't create node container");

// Clean up things to not alter the state of the running docker
cont.remove().expect("Couldn't remove the container");
image.remove().expect("Couldn't remove the image");

Structs

Container

Container

ContainerConfig
HostConfig
Mounts
Port