shiplift
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 = 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 Docker;
use Url;
let docker = host;
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 Docker;
let mut docker = Docker.new;
let mut images = docker.images;
list host-local images
for i in images.list.unwrap
find remote images
for i in image.search.unwrap
creating new images from existing image
todo
accessing image info
let mut img = images.get;
inspecting image info
println!;
getting image history
for h in img.history.unwrap
deleting image
println!;
containers
Containers are instances of images. To gain access to this interface use docker.containers()
extern crate shiplift;
use Docker;
let mut docker = Docker.new;
let mut containers = docker.containers;
listing host local containers
for c in contains.list.unwrap
get a container reference
let mut container = containers.get;
inspect container details
println!;
access top info
println!;
view container logs
(todoc)
view a list of container changes
for c in container.changes.unwrap
stream container stats
for stats in container.stats.unwrap
stop, start, restart container
container.stop;
container.start;
container.restart;
misc
todoc
Doug Tangren (softprops) 2015