Bollard is an asynchronous Rust client library for the Docker and Podman container runtime APIs. Built on Hyper and Tokio, it exposes a fully async API that embraces futures, streams, and theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/fussybeaver/bollard/llms.txt
Use this file to discover all available pages before exploring further.
async/await paradigm. Whether you are automating container lifecycle management, building CI/CD tooling, or integrating container operations into a larger Rust service, Bollard gives you idiomatic, type-safe access to the full Docker Engine API — with no blocking calls.
Key Features
Async/Await First
Every API call returns a
Future or a Stream. No thread pools, no blocking — pure async Rust powered by Tokio.Multiple Transports
Connect via Unix socket, Windows named pipe, plain HTTP/TCP, SSH tunnel, or Rustls-secured HTTPS. Choose the right transport for your environment.
Docker & Podman
Both Docker and Podman are first-class runtimes. Automatic socket discovery handles rootless Podman out of the box on Unix systems.
BuildKit Support
Native integration with BuildKit for advanced image builds, including gRPC-based communication via the
buildkit feature.Swarm & Services
Full API coverage for Docker Swarm: create and manage services, tasks, nodes, secrets, and configs — everything you need for orchestrated deployments.
Streaming Responses
Pull image layers, tail container logs, and stream live container stats as async iterators using
futures_util::stream::TryStreamExt.Library Architecture
Bollard is organized into focused modules, each corresponding to a Docker API resource group. The central entry point is theDocker struct, re-exported at the crate root.
| Module | Description |
|---|---|
bollard::container | Create, start, stop, inspect, and remove containers |
bollard::image | Pull, build, tag, push, and list images |
bollard::network | Create and manage Docker networks |
bollard::volume | Create and manage Docker volumes |
bollard::exec | Execute commands inside running containers |
bollard::swarm | Initialize and manage Docker Swarm clusters |
bollard::service | Deploy and manage Swarm services |
bollard::system | Daemon info, events, version negotiation, and pruning |
bollard::auth | Registry authentication credentials |
bollard::config | Docker Swarm config objects |
bollard::context | Docker context management |
bollard::errors | Error types returned by all API methods |
bollard::node | Swarm node inspection and management |
bollard::plugin | Docker plugin management |
bollard::secret | Docker Swarm secrets |
bollard::task | Swarm task inspection |
bollard::grpc | Low-level gRPC transport for BuildKit integration |
bollard::models | Re-exported serialization types from bollard-stubs |
bollard::query_parameters | Re-exported builder types for every API method’s options |
bollard::models) and query parameter builders (bollard::query_parameters) are generated from the Docker OpenAPI schema and BuildKit protobuf definitions, then re-exported directly from bollard — you do not need to add bollard-stubs as a separate dependency.
Docker API Version
Bollard targets the Docker Engine API v1.52 (the latest schema published by the moby project) and also supports v1.53 via version negotiation. You can calldocker.negotiate_version().await to automatically downgrade to the version your daemon actually supports.
The
bollard-stubs crate that ships serialization types is versioned at 1.53.1-rc.29.3.1 to track the upstream OpenAPI schema releases. You do not need to manage this dependency manually — it is a re-export from bollard.Latest Release
Bollard is published to crates.io. Add it to your project with:Cargo.toml
Full API documentation is available at docs.rs/bollard. The source code and issue tracker are hosted at github.com/fussybeaver/bollard.
Next Steps
Quickstart
Connect to a local Docker daemon, list containers, and stream stats in under 10 minutes.
Installation
Choose feature flags for your transport, TLS provider, datetime library, and BuildKit support.
