7 releases

Uses old Rust 2015

0.1.6 Aug 31, 2019
0.1.5 Mar 16, 2019

#4 in #docker-api

Download history 17/week @ 2023-10-29 8/week @ 2023-11-05 17/week @ 2023-11-12 7/week @ 2023-11-19 34/week @ 2023-11-26 11/week @ 2023-12-03 13/week @ 2023-12-10 5/week @ 2023-12-17 18/week @ 2023-12-24 2/week @ 2023-12-31 4/week @ 2024-01-07 6/week @ 2024-01-14 12/week @ 2024-01-21 23/week @ 2024-01-28 10/week @ 2024-02-04 30/week @ 2024-02-11

76 downloads per month
Used in 2 crates

MIT license

20KB
423 lines

Dockers

A rust docker library.

The main difference with other docker libs is that I didn't see the need of making this async (and use futures) for my use case so this is a plain sync method wrapper around the docker api. You can make sync work with this and, if needed, implement async code on top of it, but for that, you probably prefer other options out there.

Example

extern crate dockers;

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

fn main () {
    let img = Image::pull("debian".to_owned(), None)
        .expect("Cannot pull image");

    let cont = Container::new(None, Some("debian".to_owned()))
        .create(Some("my_debian_cont_name".to_owned(), None))
        .expect("Cannot create container");

    // Do your things...

    cont.remove();
    img.remove();
}

Roadmap

  • Really simple api for common use cases
  • Cover complex use cases with custom methods
  • Allow configurations ala docker compose

lib.rs:

Dockers

Dockers is a docker api wrapper for rust, it's mainly focused on ease of use, asyncronous by default and exposing a low level api.

Example

extern crate dockers;

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

fn main () {
    let img = Image::pull("rabbitmq".to_owned(), None)
        .expect("Cannot pull image");

    let cont = Container::new(None, Some("rabbitmq".to_owned()))
        .create(Some("my_rabbitmq".to_owned()), None)
        .expect("Cannot create container");

    // Do your things...

    cont.remove();
    img.remove();
}

Dependencies

~14–24MB
~352K SLoC