shiplift 0.1.0

A modern multi-transport syslog appender.
docs.rs failed to build shiplift-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: shiplift-0.7.0

shiplift

Build Status

a rust interface for maneuvering docker containers

docs

Find them here

usage

communicating with hosts

To use shiplift you must first have a running docker daemon readily accessible. Typically this daemon is reachable via url identified by an env named DOCKER_HOST. If you are using osx, boot2docker typically will have already set up every thing you need to get started.

extern crate shiplift;
let docker = shiplift::Docker::new();

If you wish to be more explicit you can provide a host in the form of a url.Url.

extern crate shiplift;
extern crate url;

use shiplift::Docker;
use url::Url;

let docker = Docker::host(Url::parse("http://yourhost").unwrap());

images

If you are interacting with docker containers, chances are you will also need to interact with docker image information. You can interact docker images with docker.images().

extern crate shiplift;

use shiplift::Docker;

let mut docker = Docker.new();
let mut images = docker.images();

list host-local images

for i in images.list().unwrap() {
  println!("-> {:?}", i);
}

find remote images

for i in image.search("rust").unwrap() {
  println!("- {:?}", i);
}

creating new images from existing image

todo

accessing image info

let mut img = images.get("imagename");
inspecting image info
println!("- {:?}", img.inspect().unwrap());
getting image history
for h in img.history().unwrap() {
  println!("- {:?}", h);
}
deleting image
println!("- {:?}", img.delete().unwrap());

containers

Containers are instances of images. To gain access to this interface use docker.containers()

extern crate shiplift;

use shiplift::Docker;

let mut docker = Docker.new();
let mut containers = docker.containers();

listing host local containers

for c in contains.list().unwrap() {
  println!("- {:?}", c);
}

get a container reference

let mut container = containers.get("containerid");

inspect container details

println!("- {:?}", container.inspect());

access top info

println!("- {:?}", container.top().unwrap());

view container logs

(todoc)

view a list of container changes

for c in container.changes().unwrap() {
  println!("- {:?}", c);
}

stream container stats

for stats in container.stats().unwrap() {
  println!("- {:?}", stats);
}

stop, start, restart container

container.stop();
container.start();
container.restart();

misc

todoc

Doug Tangren (softprops) 2015