Skip to main content

Documentation 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.

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 the 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 the Docker struct, re-exported at the crate root.
ModuleDescription
bollard::containerCreate, start, stop, inspect, and remove containers
bollard::imagePull, build, tag, push, and list images
bollard::networkCreate and manage Docker networks
bollard::volumeCreate and manage Docker volumes
bollard::execExecute commands inside running containers
bollard::swarmInitialize and manage Docker Swarm clusters
bollard::serviceDeploy and manage Swarm services
bollard::systemDaemon info, events, version negotiation, and pruning
bollard::authRegistry authentication credentials
bollard::configDocker Swarm config objects
bollard::contextDocker context management
bollard::errorsError types returned by all API methods
bollard::nodeSwarm node inspection and management
bollard::pluginDocker plugin management
bollard::secretDocker Swarm secrets
bollard::taskSwarm task inspection
bollard::grpcLow-level gRPC transport for BuildKit integration
bollard::modelsRe-exported serialization types from bollard-stubs
bollard::query_parametersRe-exported builder types for every API method’s options
Serialization types (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 call docker.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
[dependencies]
bollard = "0.21"
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.

Build docs developers (and LLMs) love