Bollard is published to crates.io and can be added to any Rust project via Cargo. The crate uses Cargo feature flags to keep the default binary small while making optional capabilities — TLS, SSH, BuildKit, WebSocket, and datetime support — available on demand.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.
Basic Installation
Addbollard and a Tokio runtime to your Cargo.toml:
Cargo.toml
The default feature set enables
http (HTTP/TCP transport) and pipe (Unix sockets and Windows named pipes). This covers local Docker access on all platforms and remote access over plain TCP without TLS.Quick Start: Choosing Features by Use Case
| Use Case | Cargo.toml |
|---|---|
| Local Docker (Unix / Windows) | bollard = "0.21" (defaults work) |
| Remote Docker over HTTPS | bollard = { version = "0.21", features = ["ssl"] } |
| SSH tunnel to remote Docker | bollard = { version = "0.21", features = ["ssh"] } |
| BuildKit image builds | bollard = { version = "0.21", features = ["buildkit", "chrono"] } |
| WebSocket container attach | bollard = { version = "0.21", features = ["websocket"] } |
| Minimal binary size | bollard = { version = "0.21", default-features = false, features = ["pipe"] } |
Feature Flag Reference
Default Features
Two features are enabled automatically. You can opt out withdefault-features = false.
| Feature | Description |
|---|---|
http | HTTP/TCP connector — enables DOCKER_HOST=tcp://... connections |
pipe | Unix socket (Linux/macOS) and Windows named pipe for local Docker/Podman |
Transport Features
| Feature | Description |
|---|---|
http | HTTP/TCP connector for remote Docker/Podman |
pipe | Unix socket / Windows named pipe for local Docker/Podman |
ssh | SSH tunnel connector via openssh |
TLS / SSL Features
These features add encrypted transport using Rustls. Pick one crypto provider:| Feature | Description |
|---|---|
ssl | Rustls with the ring crypto provider — recommended for most projects |
aws-lc-rs | Rustls with the aws-lc-rs provider — FIPS-compliant |
ssl_providerless | Rustls without a bundled crypto provider — bring your own CryptoProvider |
webpki | Use Mozilla’s root certificates (via webpki-roots) instead of OS-native certificates |
DateTime Features
These features add timestamp support in Docker events and log messages. Pick one:BuildKit Features
| Feature | Description |
|---|---|
buildkit | Full BuildKit support, including gRPC transport. Automatically enables ssl. |
buildkit_providerless | BuildKit support without a bundled TLS crypto provider — bring your own CryptoProvider. |
Cargo.toml
WebSocket Features
| Feature | Description |
|---|---|
websocket | Enables Docker::attach_container_websocket using tokio-tungstenite |
Development Features
| Feature | Description |
|---|---|
json_data_content | Include the raw JSON payload inside deserialization error messages — useful for debugging API responses |
Cargo.toml Configuration Examples
Verifying Your Installation
After updatingCargo.toml, run cargo build to fetch and compile Bollard and its dependencies. Then confirm the connection with a quick version check:
src/main.rs
Next Steps
Introduction
Learn about Bollard’s architecture, modules, and API version support.
Quickstart
Connect to a daemon, list containers, and stream stats with working code examples.
