Docker daemon API in Rust

Overview

crates.io license circle-ci appveyor docs

Bollard: an asynchronous rust client library for the docker API

Bollard leverages the latest Hyper and Tokio improvements for an asynchronous API containing futures, streams and the async/await paradigm.

The library also features Windows support through Named Pipes (disabled in 0.10, see below) and HTTPS support through optional rustls bindings.

Install

Add the following to your Cargo.toml file

[dependencies]
bollard = "0.9"

API

Documentation

API docs.

Version 0.10 disables Named Pipe Windows support until the upstream Tokio project re-adds support for Named Pipes. Please follow the tracking issue for updates on this.

As of version 0.6, this project now generates API stubs from the upstream Docker-maintained Swagger OpenAPI specification. The generated models are committed to this repository, but packaged in a separate crate bollard-stubs.

Version

The Docker API is pegged at version 1.40. The library also supports version negotiation, to allow downgrading to an older API version.

Usage

Connecting with the docker daemon

Connect to the docker server according to your architecture and security remit.

Unix socket

The client will connect to the standard unix socket location /var/run/docker.sock. Use the Docker::connect_with_unix method API to parameterise the interface.

use bollard::Docker;
#[cfg(unix)]
Docker::connect_with_unix_defaults();

Local

The client will connect to the OS specific handler it is compiled for. This is a convenience for localhost environment that should run on multiple operating systems. Use the Docker::connect_with_local method API to parameterise the interface.

use bollard::Docker;
Docker::connect_with_local_defaults();

HTTP

The client will connect to the location pointed to by DOCKER_HOST environment variable, or localhost:2375 if missing. Use the Docker::connect_with_http method API to parameterise the interface.

use bollard::Docker;
Docker::connect_with_http_defaults();

SSL via Rustls

The client will connect to the location pointed to by DOCKER_HOST environment variable, or localhost:2375 if missing.

The location pointed to by the DOCKER_CERT_PATH environment variable is searched for certificates - key.pem for the private key, cert.pem for the server certificate and ca.pem for the certificate authority chain.

Use the Docker::connect_with_ssl method API to parameterise the interface.

use bollard::Docker;
#[cfg(feature = "ssl")]
Docker::connect_with_ssl_defaults();

Examples

Note: all these examples need a Tokio Runtime.

Version

First, check that the API is working with your server:

use bollard::Docker;

use futures_util::future::FutureExt;

// Use a connection function described above
// let docker = Docker::connect_...;

async move {
    let version = docker.version().await.unwrap();
    println!("{:?}", version);
};

Listing images

To list docker images available on the Docker server:

use bollard::Docker;
use bollard::image::ListImagesOptions;

use futures_util::future::FutureExt;

use std::default::Default;

// Use a connection function described above
// let docker = Docker::connect_...;

async move {
    let images = &docker.list_images(Some(ListImagesOptions::<String> {
        all: true,
        ..Default::default()
    })).await.unwrap();

    for image in images {
        println!("-> {:?}", image);
    }
};

Streaming Stats

To receive a stream of stats for a running container.

use bollard::Docker;
use bollard::container::StatsOptions;

use futures_util::stream::TryStreamExt;

use std::default::Default;

// Use a connection function described above
// let docker = Docker::connect_...;

async move {
    let stats = &docker.stats("postgres", Some(StatsOptions {
       stream: true,
       ..Default::default()
    })).try_collect::<Vec<_>>().await.unwrap();

    for stat in stats {
        println!("{} - mem total: {:?} | mem usage: {:?}",
            stat.name,
            stat.memory_stats.max_usage,
            stat.memory_stats.usage);
    }
};

Examples

Further examples are available in the examples folder, or the integration/unit tests.

Development

Contributions are welcome, please observe the following advice.

Building the stubs

Serialization stubs are generated through the Swagger library. To generate these files, use the following in the codegen folder:

mvn -D org.slf4j.simpleLogger.defaultLogLevel=debug clean compiler:compile generate-resources

History

This library was originally forked from the boondock rust library. Many thanks to the original authors for the initial code and inspiration.

Integration tests

Running the integration tests by default requires a running docker registry, with images tagged and pushed there. To disable this behaviour, set the DISABLE_REGISTRY environment variable.

docker run -d --restart always --name registry -p 5000:5000 registry:2
docker pull hello-world:linux
docker pull fussybeaver/uhttpd
docker pull alpine
docker tag hello-world:linux localhost:5000/hello-world:linux
docker tag fussybeaver/uhttpd localhost:5000/fussybeaver/uhttpd
docker tag alpine localhost:5000/alpine
docker push localhost:5000/hello-world:linux
docker push localhost:5000/fussybeaver/uhttpd
docker push localhost:5000/alpine
docker swarm init
REGISTRY_HTTP_ADDR=localhost:5000 cargo test -- --test-threads 1

License: Apache-2.0

Comments
  • WIP - Use buildkit for building images

    WIP - Use buildkit for building images

    WIP - Doesn't work

    Description:

    • Build images using buildkit
    • Adds git submodules for buildkit gRPC codegen
    • Doesn't work yet, but we get a HTTP 101 when upgrading via /session endpoint on the docker API

    Run the buildkit test

    cargo run --example build_buildkit --features buildkit
    
    opened by cmac4603 12
  • Bollard is reading partial json data in `create_image`

    Bollard is reading partial json data in `create_image`

    When using create_image we've stumbled with the following error on our CI. It appears randomly just due to the nature of this bug. Looks like the response stream that bollard receives from docker may be read in chunks that are not aligned with the JSON data.

    Here is the log from our test that failed due to this bug:

      Jan 25 16:27:41.489 DEBUG bollard::read: Decoding JSON line from stream: {"status":"Extracting","progressDetail":{"current":33980416,"total":102266715}
    
      Jan 25 16:27:41.489 DEBUG bollard::read: Decoding JSON line from stream: ,"progress":"[================\u003e                                  ]  33.98MB/102.3MB","id":"14d349bd5978"}
    
    
    thread 'smoke::local_smoke_test' panicked at 'called `Result::unwrap()` on an `Err` value: DockerSdk(Raw(JsonSerdeError { err: Error("expected value", line: 1, column: 1) }))',
    

    The first read ended up with a chunk in the middle of the JSON object, so is_eof() returned true here: https://github.com/fussybeaver/bollard/blob/a457b0fc7cc604054bd8f591f7a03190273496ef/src/read.rs#L118

    But the next line resulted in a JSON parsing error right at the start, so the error was returned.

    The invocation of create_image() in our test looks like this:

    self.create_image(
        Some(bollard::image::CreateImageOptions {
            from_image: "amazon/dynamodb-local:1.18.0",
            ..Default::default()
        }),
        /* root_fs */ None,
        /* credentials */ None,
    )
    .try_for_each(|info| {
        debug!(
            image,
            status = info.status.as_deref(),
            progress = info.progress.as_deref(),
            "Pulling..."
        );
        future::ok(())
    })
    .await;
    
    opened by Veetaha 10
  • New MemoryStatsStats enum prevents json deserialization

    New MemoryStatsStats enum prevents json deserialization

    Hi,

    we've got problems with this change. We are running api 1.41.

    image

    While everything works fine, we got errors streaming stats with the new variants.

    image

    The json result from stream looks exactly like ContainerStats, which does not know about c groups.

    {
      "read": "2021-05-02T05:10:29.5953243Z",
      "preread": "2021-05-02T05:10:28.5614296Z",
      "pids_stats": { "current": 18 },
      "blkio_stats": {
        "io_service_bytes_recursive": [],
        "io_serviced_recursive": [],
        "io_queue_recursive": [],
        "io_service_time_recursive": [],
        "io_wait_time_recursive": [],
        "io_merged_recursive": [],
        "io_time_recursive": [],
        "sectors_recursive": []
      },
      "num_procs": 0,
      "storage_stats": {},
      "cpu_stats": {
        "cpu_usage": {
          "total_usage": 193674787300,
          "percpu_usage": [
            38839858700,
            7732528900,
            40562396900,
            9015874200,
            38276766600,
            11291387200,
            38560103400,
            9395871400
          ],
          "usage_in_kernelmode": 26410000000,
          "usage_in_usermode": 78130000000
        },
        "system_cpu_usage": 4438290140000000,
        "online_cpus": 8,
        "throttling_data": {
          "periods": 0,
          "throttled_periods": 0,
          "throttled_time": 0
        }
      },
      "precpu_stats": {
        "cpu_usage": {
          "total_usage": 193673934900,
          "percpu_usage": [
            38839686400,
            7732409700,
            40562396900,
            9015874200,
            38276205700,
            11291387200,
            38560103400,
            9395871400
          ],
          "usage_in_kernelmode": 26410000000,
          "usage_in_usermode": 78130000000
        },
        "system_cpu_usage": 4438281850000000,
        "online_cpus": 8,
        "throttling_data": {
          "periods": 0,
          "throttled_periods": 0,
          "throttled_time": 0
        }
      },
      "memory_stats": {
        "usage": 196747264,
        "max_usage": 199966720,
        "stats": {
          "active_anon": 89210880,
          "active_file": 946176,
          "cache": 4653056,
          "dirty": 405504,
          "hierarchical_memory_limit": 9223372036854771712,
          "hierarchical_memsw_limit": 9223372036854771712,
          "inactive_anon": 92180480,
          "inactive_file": 3108864,
          "mapped_file": 135168,
          "pgfault": 366630,
          "pgmajfault": 66,
          "pgpgin": 205755,
          "pgpgout": 185872,
          "rss": 180195328,
          "rss_huge": 100663296,
          "total_active_anon": 89210880,
          "total_active_file": 946176,
          "total_cache": 4653056,
          "total_dirty": 405504,
          "total_inactive_anon": 92180480,
          "total_inactive_file": 3108864,
          "total_mapped_file": 135168,
          "total_pgfault": 366630,
          "total_pgmajfault": 66,
          "total_pgpgin": 205755,
          "total_pgpgout": 185872,
          "total_rss": 180195328,
          "total_rss_huge": 100663296,
          "total_unevictable": 0,
          "total_writeback": 0,
          "unevictable": 0,
          "writeback": 0
        },
        "limit": 13355659264
      },
      "name": "/home-assistant",
      "id": "2a7054d569ebeb767d6d4eead95833a765c5fa3c443330fdb94366bd7c0cc913",
      "networks": {
        "eth0": {
          "rx_bytes": 739081,
          "rx_packets": 6900,
          "rx_errors": 0,
          "rx_dropped": 0,
          "tx_bytes": 2196039,
          "tx_packets": 21172,
          "tx_errors": 0,
          "tx_dropped": 0
        }
      }
    }
    

    Am i missing something? If you need further information or investigation, just give me a ping :)

    Kind regards Alexander

    Originally posted by @aserowy in https://github.com/fussybeaver/bollard/issues/143#issuecomment-830742638

    opened by aserowy 10
  • Incorrect model for IPAM config settings

    Incorrect model for IPAM config settings

    The current model for IPAM configuration is incorrect. It currently (https://cs.github.com/fussybeaver/bollard/blob/5effe1a16363d929e290919bca6542bbfaccd45a/codegen/target/generated-sources/src/models.rs#L1991) assumes a map of string keys to string values but the values can be more complex than this. One such example is the AuxiliaryAddresses setting which rather than having a string value is actually a map of strings to addresses.

    One of my servers is using this, the list networks API call returns the following for the network in question:

    {
        "Name": "services",
        "Id": "18e9cdac5d71b5b050b804b6d9d07aaa4104a986bf478e89057a088724c6328e",
        "Created": "2022-02-19T16:14:03.323536217Z",
        "Scope": "local",
        "Driver": "macvlan",
        "EnableIPv6": false,
        "IPAM": {
          "Driver": "default",
          "Options": null,
          "Config": [
            {
              "Subnet": "10.10.0.0/20",
              "IPRange": "10.10.12.0/24",
              "Gateway": "10.10.15.254",
              "AuxiliaryAddresses": { "bad": "10.10.12.0", "host": "10.10.12.1" }
            }
          ]
        },
        "Internal": false,
        "Attachable": true,
        "Ingress": false,
        "ConfigFrom": { "Network": "" },
        "ConfigOnly": false,
        "Containers": {},
        "Options": {
          "com.docker.network.bridge.name": "services",
          "parent": "enp1s0"
        },
        "Labels": {
          "com.docker.compose.network": "services",
          "com.docker.compose.project": "srv",
          "com.docker.compose.version": "1.24.1"
        }
      }
    

    Bollard returns an error on encountering this due to the incorrect model: Failed to deserialize JSON: invalid type: map, expected a string at line 1 column 1057.

    opened by Mossop 7
  • Target field of ListContainers mounts is always None

    Target field of ListContainers mounts is always None

    Summary of the issue: ListContainers > ContainerSummaryInner > Mounts > Mount > Target == None for all containers despite docker container inspect showing the data exists.

    Mounts for a container:

    Some([Mount { target: None, source: Some("/var/run/docker.sock"), typ: Some(BIND), read_only: None, consistency: None, bind_options: None, volume_options: None, tmpfs_options: None }, Mount { target: None, source: Some("/var/lib/docker/volumes/portainer_data/_data"), typ: Some(VOLUME), read_only: None, consistency: None, bind_options: None, volume_options: None, tmpfs_options: None }])
    

    Target for /var/run/docker.sock should be /var/run/docker.sock
    Target for /var/lib/docker/volumes/portainer_data/_data should be /data

    opened by thechubbypanda 6
  • Fix NewlineLogOutputDecoder

    Fix NewlineLogOutputDecoder

    Currently NewlineLogOutputDecoder works incorrect, decode always produce message even if no \n at end of line. decode also remove newline, so it's not possible distinguish is it was part of message of full message. shiplift implements this correctly, see https://github.com/softprops/shiplift/blob/a4cd2185976ad56b880d5a10374c4dee6d116e6a/src/tty.rs#L79-L147

    • What should be fixed for this change in crate?
    • Since this breaking change, 0.7.0 will be required, is this ok for you?
    • What about return Bytes instead String?
    opened by fanatid 6
  • Updates to the v1.40 upstream Docker API

    Updates to the v1.40 upstream Docker API

    • Updates the API stubs according to upstream changes.
    • Removes the deny_unknown_fields constraint (thanks @edigaryev )
    • Adds mount option to creating containers
    opened by fussybeaver 6
  • Remove `Connect` type parameter in `Docker`

    Remove `Connect` type parameter in `Docker`

    As mentioned in #17, the issues with requiring a Connect type parameter to the Docker structure entails that it is not usable in certain scenarios.

    This PR introduces the following changes:

    • Remove the Connect type parameter.
    • Remove the generic Docker::connect_with method.
    • Introduce a Docker::connect_with_host_to_reply that is only available in test.
    • Convert all unit tests from Docker::connect_with to Docker::connect_with_host_to_reply.
    • Introduce Docker::connect_with_local and Docker::connect_with_local_defaults.

    This change is a breaking change, and will require a major version bump if merged (e.g., 0.3).

    opened by veeg 6
  • Don't use impl Connect in return types

    Don't use impl Connect in return types

    Currently functions like BollardDockerApi::connect_with_unix_defaults return Result<Docker<impl Connect>, Error>. This has some downsides from the API viewpoint: the users of the API are unable to store the returned value in a struct, because Rust doesn't allow using impl Connect in structs yet. It would be better to just return a concrete type for the time being.

    opened by golddranks 6
  • Error while building an image: the --mount option requires BuildKit. Refer to https://docs.docker.com/go/buildkit/ to learn how to build images with BuildKit enabled

    Error while building an image: the --mount option requires BuildKit. Refer to https://docs.docker.com/go/buildkit/ to learn how to build images with BuildKit enabled

    I receive this error while attempting to build https://github.com/matrix-org/synapse/ (the Dockerfile is in docker/Dockerfile).

    I haven't found a way to work around this with Bollard yet. I don't know if it's something that needs to be added to/made easier to find in the documentation or something that requires a code change.

    According to my logs

    {
      "Platform": {
        "Name": ""
      },
      "Components": [
        {
          "Name": "Engine",
          "Version": "20.10.12",
          "Details": {
            "ApiVersion": "1.41",
            "Arch": "amd64",
            "BuildTime": "2022-02-10T15:03:35.000000000+00:00",
            "Experimental": "false",
            "GitCommit": "20.10.12-0ubuntu2~20.04.1",
            "GoVersion": "go1.16.2",
            "KernelVersion": "5.4.0-113-generic",
            "MinAPIVersion": "1.12",
            "Os": "linux"
          }
        },
        {
          "Name": "containerd",
          "Version": "1.5.9-0ubuntu1~20.04.4",
          "Details": {
            "GitCommit": ""
          }
        },
        {
          "Name": "runc",
          "Version": "1.1.0-0ubuntu1~20.04.1",
          "Details": {
            "GitCommit": ""
          }
        },
        {
          "Name": "docker-init",
          "Version": "0.19.0",
          "Details": {
            "GitCommit": ""
          }
        }
      ],
      "Version": "20.10.12",
      "ApiVersion": "1.41",
      "MinAPIVersion": "1.12",
      "GitCommit": "20.10.12-0ubuntu2~20.04.1",
      "GoVersion": "go1.16.2",
      "Os": "linux",
      "Arch": "amd64",
      "KernelVersion": "5.4.0-113-generic",
      "BuildTime": "2022-02-10T15:03:35.000000000+00:00"
    }
    
    help wanted 
    opened by Yoric 5
  • NewlineLogOutputDecoder doesn't always correctly split

    NewlineLogOutputDecoder doesn't always correctly split

    Hello, I've noticed that the stdout stream from Docker::exec seems to have some trouble splitting on large amounts of data. I'm currently using stdin/stdout as a communication channel between my container and host (sending base64 encoded messages back-and-forth), as the container has no other means of communication (no network and such), and I've found that I have to wrap each line of output in BufRead::lines(Cursor::new(line.to_string())) to correctly split everything (though this isn't the biggest issue). My main issue is that if I send relatively large amounts of text (~100kb), the lines given to me seem to be cut off, which causes issues as my messages become cut in half. Is there any way I can solve this?

    opened by uellenberg 5
  • buildkit

    buildkit "no active sessions"

    Added the Bollard to Nixpacks (https://github.com/railwayapp/nixpacks/pull/709) and having the "no active sessions error"

    To test, pull down that branch and run cargo run build ./examples/node

    opened by JakeCooper 10
  • Update base64 requirement from 0.13 to 0.20

    Update base64 requirement from 0.13 to 0.20

    Updates the requirements on base64 to permit the latest version.

    Changelog

    Sourced from base64's changelog.

    0.20.0

    Breaking changes

    • Update MSRV to 1.57.0
    • Decoding can now either ignore padding, require correct padding, or require no padding. The default is to require correct padding.
      • The NO_PAD config now requires that padding be absent when decoding.

    0.20.0-alpha.1

    Breaking changes

    • Extended the Config concept into the Engine abstraction, allowing the user to pick different encoding / decoding implementations.
      • What was formerly the only algorithm is now the FastPortable engine, so named because it's portable (works on any CPU) and relatively fast.
      • This opens the door to a portable constant-time implementation (#153, presumably ConstantTimePortable?) for security-sensitive applications that need side-channel resistance, and CPU-specific SIMD implementations for more speed.
      • Standard base64 per the RFC is available via DEFAULT_ENGINE. To use different alphabets or other settings (padding, etc), create your own engine instance.
    • CharacterSet is now Alphabet (per the RFC), and allows creating custom alphabets. The corresponding tables that were previously code-generated are now built dynamically.
    • Since there are already multiple breaking changes, various functions are renamed to be more consistent and discoverable.
    • MSRV is now 1.47.0 to allow various things to use const fn.
    • DecoderReader now owns its inner reader, and can expose it via into_inner(). For symmetry, EncoderWriter can do the same with its writer.
    • encoded_len is now public so you can size encode buffers precisely.

    0.13.1

    • More precise decode buffer sizing, avoiding unnecessary allocation in decode_config.

    0.13.0

    • Config methods are const
    • Added EncoderStringWriter to allow encoding directly to a String
    • EncoderWriter now owns its delegate writer rather than keeping a reference to it (though refs still work)
      • As a consequence, it is now possible to extract the delegate writer from an EncoderWriter via finish(), which returns Result<W> instead of Result<()>. If you were calling finish() explicitly, you will now need to use let _ = foo.finish() instead of just foo.finish() to avoid a warning about the unused value.
    • When decoding input that has both an invalid length and an invalid symbol as the last byte, InvalidByte will be emitted instead of InvalidLength to make the problem more obvious.

    0.12.2

    • Add BinHex alphabet

    0.12.1

    • Add Bcrypt alphabet

    0.12.0

    • A Read implementation (DecoderReader) to let users transparently decoded data from a b64 input source
    • IMAP's modified b64 alphabet
    • Relaxed type restrictions to just AsRef<[ut8]> for main encode*/decode* functions
    • A minor performance improvement in encoding

    0.11.0

    • Minimum rust version 1.34.0

    ... (truncated)

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies rust 
    opened by dependabot[bot] 0
  • Why are all informations wrapped in an `Option` in `ContainerSummary`?

    Why are all informations wrapped in an `Option` in `ContainerSummary`?

    I used the Docker::list_containers method to list all existing containers, which returns a list of ContainerSummary values.

    But every field of that struct is wrapped in an Option! For instance, even the container's ID is declared as id: Option<String>. Why is that?

    I'm curious to know the reason why we need to unwrap these values every time, isn't the underlying socket method guaranteed to return some informations like the ID?

    opened by ClementNerma 3
  • Strange behavior building an image

    Strange behavior building an image

    Hello Goodnight!. I am testing an example of the slightly modified lib it would be running like this.

        build_image_args.insert("version_url", versionNumber.as_str());
        build_image_args.insert("version_number", versionUrl.as_str());
    
        let build_image_options = BuildImageOptions {
            remote: dockerfileUrl.as_str(), //url to a regular Dockerfile
            buildargs: build_image_args,
            ..Default::default()
        };
    
        let mut image_build_stream = docker.build_image(build_image_options, None, None);
    
        while let Some(msg) = image_build_stream.next().await {
            println!("Message: {:?}", msg);
        }
    

    Dockerfile

    When executing this code, an unusual behavior begins, first two images are created, one with the name Ubuntu and the other None, then containers are created up to a total of 21.

    I leave the captures of how the final result looks.

    Captura de Pantalla 2022-10-07 a la(s) 23 00 49 Captura de Pantalla 2022-10-07 a la(s) 23 01 05

    And these are the two images created. Captura de Pantalla 2022-10-07 a la(s) 23 01 48 Captura de Pantalla 2022-10-07 a la(s) 23 01 58

    Docker version

    Captura de Pantalla 2022-10-08 a la(s) 11 50 15

    Any idea what my mistake would be?

    opened by orelvis15 3
  • [WIP] example of attach output stream not closing

    [WIP] example of attach output stream not closing

    This PR provides a reproducible example of the output stream from attach_container not closing even after container exit has been reported via the wait_container stream. This is not intended to actually be merged, but is just an example for https://github.com/fussybeaver/bollard/issues/251.

    opened by tdyas 0
  • container exits but output stream remains open

    container exits but output stream remains open

    I am trying to capture output from a running container using Docker::attach_container but it appears that the output stream does not close even though the container exited (and which was reported via the wait_container stream). The code at issue is in this PR https://github.com/pantsbuild/pants/pull/16766.

    That code monitors the output stream returned by attach_container and the stream from wait_container for the exit code with a tokio::select!. When the container exits, the code breaks out of the monitoring loop and then tries to see if any output remains on the output stream, but that stream never closes so the code hangs there.

    Am I somehow not using the APIs correctly? (The machine is macOS 12.5.1 with Docker Desktop 4.11.1.)

    opened by tdyas 10
Releases(v0.13.0)
  • v0.13.0(Jun 20, 2022)

    Release v0.13.0

    • 304 Status code should be treated as a success (thanks @y-young )
    • Allow large response payloads in start exec response using an optional output capacity (thanks @uellenberg )
    • Do not error on empty server response (thanks @k8scat )
    • Bump models to match moby v20.10.16
    • Add chrono feature flag and alternative mutually exclusive time feature flag as alternative representations of dates.
    • Deserialize directly from bytes instead of through a string.
    • Add json_data_content feature flag to enable appending JSON payloads to deserialization errors.
    Source code(tar.gz)
    Source code(zip)
  • v0.12.0(Apr 5, 2022)

    Release v0.12.0

    • Bump rustls, make ct_logs dependency optional
    • Add container attach method (thanks @antoinert )
    • Add resize container tty method (thanks @antoinert )
    • Fix bugs in JSON parser:
      • handle buffers ending in closing brace and not being parseable
      • handle newlines inside of JSON payload
    • Let users specify a timeout
    • Fix clippy failures on Rust version 1.59 (thanks @edmorley )
    • Make all SSL dependencies optional (thanks @edmorley )
    • Switch from pin-project to pin-project-lite dependency (thanks @edmorley )
    • Clean up tokio features (thanks @edmorley )
    • Enforce cargo fmt in CI
    • Make all Docker errors generic
    • Bump bollard-stubs models to a pre-1.42 API release
    • Add PartialEq to all options
    Source code(tar.gz)
    Source code(zip)
  • v0.11.1(Dec 6, 2021)

    Release v0.11.1

    • Fix vulnerable swagger-codegen version from 2.4.14 to 2.4.19
    • Fix podman incompatibility, skip until argument in container logs endpoint if undefined (thanks @gdesmott )
    • Update API docs link (thanks @jareddlc )
    • Delete redundant consul dockerfiles
    • Bump AppVeyor Microsoft nanoserver image version
    • Bump CircleCi docker image version
    • Use DOCKER_HOST environment variable in connect_with_unix_default connection method (thanks @zeenix )
    • Fix CGroups V1 Memory model for OSX and linux kernel > 4.15.0-1106
    • Fix base64 URL encoding in registry authorisation (thanks @rongduan-zhu )
    • Fix JSON parsing when docker server emits double newlines
    • Fail in CircleCi task when clippy emits warnings
    • Skip time 0.1 rust sec advisory
    • Add dependabot yaml conifguration
    • Force JVM version 8 in codegen
    Source code(tar.gz)
    Source code(zip)
  • v0.11.0(Jun 20, 2021)

    Release v0.11.0

    • Re-add windows named pipes support.
    • Fix 'docker::ping' response string deserialized type (thanks @pitkley )
    • Expose 'one-shot' option for docker stats (thanks @icewind1991 )
    • Add resize TTY session in exec container (thanks @icewind1991 )
    • Allow passing input into exec container (thanks @icewind1991 )
    Source code(tar.gz)
    Source code(zip)
  • v0.10.1(Mar 3, 2021)

  • v0.10.0(Feb 27, 2021)

  • v0.9.1(Feb 5, 2021)

    Release v0.9.1

    • Fix on setting the underlying byte position in JSON reader of /events API for macOS (thanks @archoversight )
    • Add metadata to render TLS API docs and set links correctly (thanks @juchiast )
    • Replace 'http://' or 'https://' as appropriate in address parameter of connection handler.
    Source code(tar.gz)
    Source code(zip)
  • v0.9.0(Nov 23, 2020)

    Release v0.9.0

    • Add missing TTY option to CreateExecOptions (thanks @ThetaSinner )
    • Add audit to continuous integration to check for security vulnerabilities (thanks @smklein )
    • Fix Build Image into the correct stream type (thanks @01010101lzy )
    • Switch Create Image into a stream (thanks @lidin )
    • Parse non-newline terminated JSON streams (fixes events API on macos)
    • Allow arbitrary log configuration options in HostConfigLogConfig
    • Add info route (thanks @nickgerace )
    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Aug 23, 2020)

    Release v0.8.0

    • Switch AsRef to Into for all options. Change option serialization to use serde.
    • Switch from failure crate to thiserror crate for error handling.
    • Move most return types to the generated swagger API stubs.
    • Add clippy and CI pipeline.
    • Clean up dependencies (thanks @fanatid )
    Source code(tar.gz)
    Source code(zip)
  • v0.7.2(Aug 2, 2020)

  • v0.7.1(Jul 5, 2020)

  • v0.7.0(Jul 4, 2020)

  • v0.6.1(Jun 29, 2020)

    Release v0.6.1

    • Fix features flag for compile/test in native TLS code path (thanks @fanatid )
    • Add From implementation for ContainerConfig to Config
    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(Jun 14, 2020)

    Release v0.6.0

    Generate most models using the official Swagger API using a custom generator suited for this project. Models are uploaded to the bollard-stubs crate, but continue to be committed to this repository.

    Note, that the method (operator) API remains unchanged except for referencing the generated models in API parameters / return types. Some types that exist as mixed or arbitrary JSON payloads in the Docker Swagger API (e.g. Container POST Config) are still maintained as custom non-generated types.

    Source code(tar.gz)
    Source code(zip)
  • v0.5.2(Jun 14, 2020)

    Release v0.5.2

    • Add unofficial service API rollback status enum values (thanks @iyzana )
    • Make container mount optional (thanks @iyzana )
    • Change LogStateHealth exit code to i16 (thanks @SparksCreative )
    • Create Ulimit struct for the container API (thanks @ethankhall )
    • Make IPAMConfig elements optional in network API (thanks @ipoupaille )
    • Improve timestamp accuracy in events in systems API (thanks @ipoupaille )
    Source code(tar.gz)
    Source code(zip)
  • v0.5.1(Apr 16, 2020)

    Release v0.5.1

    • Service API (Create/list/update/remove), thanks @iyzana and @bittrance
    • Fix Serde issue #55 with large streams of JSON, thanks for reporting @Bunogi and @rcastill
    • Import Image API
    • Multiple PRs pruning stubs and polishing fixes thanks @Bunogi @edigaryev @mre
    Source code(tar.gz)
    Source code(zip)
  • v0.5.0(Jan 28, 2020)

    • Support for the export image endpoint /images/{}/get (thanks @Dieff )
    • Support for the import image from tarball endpoint /images/create w/ body (thanks @Dieff )
    • Support for get system data information endpoint /system/df.
    • Support for all the of the volume API /volumes/...
    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Jan 4, 2020)

  • v0.4.0-alpha.1(Nov 14, 2019)

    • Async/await using Hyper and Tokio's alpha releases (thanks @jonhoo, @akshayknarayan)
    • Fixes to network stubs (thanks @akshayknarayan) #41
    • Fixes to commit container #37
    • Make errors compatible with std::error::Error #31
    • Implement events API
    Source code(tar.gz)
    Source code(zip)
  • v0.3.3(Aug 16, 2019)

    • Implement client version negotiation. See documentation
    • Support newer Docker API versions by ignoring additional properties in API responses (thx @edigaryev !)
    • Stub updates to the v1.40 upstream Docker API
    • Fix docs.rs badge to display the latest version (thx @edigaryev !)
    • Change mock unit test connect method to public
    Source code(tar.gz)
    Source code(zip)
  • v0.3.2(Jul 19, 2019)

  • v0.3.1(May 31, 2019)

  • v0.3.0(Mar 7, 2019)

    This version introduces the following changes:

    • Remove the Connect type parameter.
    • Remove the generic Docker::connect_with method.
    • Introduce a Docker::connect_with_host_to_reply that is only available in test.
    • Convert all unit tests from Docker::connect_with to Docker::connect_with_host_to_reply.
    • Introduce Docker::connect_with_local and Docker::connect_with_local_defaults.
    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Feb 7, 2019)

    • Exec API implementation, unit tests and integration tests.
    • Change type of status_code to u64 in container wait API.
    • Fix privateworkingset field in MemoryStats for container stats API.
    • Run Windows "daemon" macro correctly in integration tests.
    • Update README to point to Bollard v0.2.
    • Peg Docker API version to 1.39.
    • Bump docker server version to 18.09.01.
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Feb 7, 2019)

    • Adds the upload_to_container and download_from_container endpoints.
    • Change fields of result enum from build_image endpoint to public, thanks @Qwaz
    • Fix remote registry authentication across multiple endpoints:
      • Breaking change add credentials argument to create_image and remove_image.
      • Use a HashMap for multiple registry authentication on build_image endpoint.
      • Make sure we base64 encode credentials.
      • Add integration tests for remote registry authentication.
    Source code(tar.gz)
    Source code(zip)
  • v0.1.3(Jan 19, 2019)

    • Adds build_image API.
    • Fix interface of the filter attribute for ListImagesOptions in the list_images API.
    • Adds Healthcheck attribute to container config.
    • Adds example for building remote images.
    Source code(tar.gz)
    Source code(zip)
  • v0.1.2(Jan 8, 2019)

    • feature: commit_container API allows to create an image out of a running container.
    • bug fix: container Cmd is optional.
    • bug fix: mispelled HostIp field.
    • bug fix: non-running doc tests in CircleCI.
    • bug fix: remove duplicate CircleCI job.
    • feature: new example showing parallel inspect API.
    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Dec 23, 2018)

Owner
Niel Drummond
Niel Drummond
Implementation of the Docker Registry HTTP API V2 in Rust, that can act as a proxy to other registries

Docker registry server and proxy (I'm bad at creating catchy names, but this one is good enough.) This project aims to implement a Docker Registry HTT

l4p1n (Mathias B.) 2 Dec 30, 2022
Docker containers on a synthetic network. Run applications in a context that lets you manipulate their network conditions.

Synthetic Network Docker containers on a synthetic network. Run applications in a context that lets you manipulate their network conditions. Dependenc

Daily 58 Dec 15, 2022
A tool for defining and running multi-container Docker applications

Ikki Ikki is a tool for defining and running multi-container Docker applications. It is similar to Docker Compose but comes with some differences. Goa

Kirill Vasiltsov 39 Dec 21, 2022
Convert your docker-compose into excalidraw

excalidocker-rs Rust-based utility to convert docker-compose.yaml files into excalidraw files. Key features Transform your local docker-compose files

Eugene Tolbakov 26 Jun 15, 2023
It's like "docker stats" but with beautiful, real-time charts into your terminal. 📊

?? ds - Real-time Stats with Terminal Charts Visualize container stats with beautiful, real-time charts directly in your terminal. Why ds? Missing Cha

Rafael R. Camargo 5 Oct 3, 2023
Modrinth API is a simple library for using Modrinth's API in Rust projects

Ferinth is a simple library for using the Modrinth API in Rust projects. It uses reqwest as its HTTP(S) client and deserialises responses to typed structs using serde.

null 20 Dec 8, 2022
The Safe Network Core. API message definitions, routing and nodes, client core api.

safe_network The Safe Network Core. API message definitions, routing and nodes, client core api. License This Safe Network repository is licensed unde

MaidSafe 101 Dec 19, 2022
Proxy copilot api to openai's gpt-4 api

Proxying Copilot API to OpenAI's GPT-4 API Usage Start the Server export GHU_TOKEN=ghu_xxxx; ./copilot2chat Or sh start.sh start # start the server th

Smark 3 Dec 6, 2023
A pure Rust implementation of WebRTC API

A pure Rust implementation of WebRTC API

WebRTC.rs 2.7k Jan 7, 2023
A rust client and structures to interact with the Clever-Cloud API.

Clever-Cloud Software Development Kit - Rust edition This crate provides structures and client to interact with the Clever-Cloud API. Status This crat

Clever Cloud 6 Jun 3, 2022
Revolt backend API server, built with Rust.

Delta Description Delta is a blazing fast API server built with Rust for Revolt. Features: Robust and efficient API routes for running a chat platform

Revolt 741 Dec 26, 2022
Podman-api-rs - Rust interface to Podman (libpod).

podman-api Rust interface to Podman Usage Add the following to your Cargo.toml file [dependencies] podman-api = "0.1" SSL Connection To enable HTTPS c

Wojciech Kępka 43 Dec 29, 2022
An implementation of the ZITADEL gRPC API in Rust.

An implementation of the ZITADEL gRPC API in Rust. Complemented with other useful elements such as ServiceAccount auth.

Christoph Bühler 10 Dec 15, 2022
A simple API gateway written in Rust, using the Hyper and Reqwest libraries.

API Gateway A simple API gateway written in Rust, using the Hyper and Reqwest libraries. This gateway can be used to forward requests to different bac

Adão Raul 3 Apr 24, 2023
A library-first, lightweight, high-performance, cloud-native supported API gateway🪐 by RUST

Preview version, will not guarantee the stability of the API! Do NOT use in production environment! A library-first, lightweight, high-performance, cl

Ideal World 4 May 7, 2023
A sample API Gateway built in Rust (work in progress) for learning purposes

rust-api-gateway A sample API Gateway built in Rust (work in progress) for learning purposes. You can follow along by reading the tutorial articles: P

Luis Soares 4 Oct 29, 2023
ZeroNS: a name service centered around the ZeroTier Central API

ZeroNS: a name service centered around the ZeroTier Central API ZeroNS provides names that are a part of ZeroTier Central's configured networks; once

ZeroTier, Inc. 327 Dec 20, 2022
A wrapper for the Google Cloud DNS API

cloud-dns is a crate providing a client to interact with Google Cloud DNS v1

Embark 5 May 24, 2022
Obtain (wildcard) certificates from let's encrypt using dns-01 without the need for API access to your DNS provider.

Agnos Presentation Agnos is a single-binary program allowing you to easily obtain certificates (including wildcards) from Let's Encrypt using DNS-01 c

Arthur Carcano 246 Dec 20, 2022