summaryrefslogtreecommitdiffstats
path: root/examples/containercreate.rs
blob: ef579a6316b2e7ac76a9eafd8097eadfbad8081e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use shiplift::{ContainerOptions, Docker};
use std::env;

#[tokio::main]
async fn main() {
    let docker = Docker::new();
    let image = env::args()
        .nth(1)
        .expect("You need to specify an image name");

    match docker
        .containers()
        .create(&ContainerOptions::builder(image.as_ref()).build())
        .await
    {
        Ok(info) => println!("{:?}", info),
        Err(e) => eprintln!("Error: {}", e),
    }
}