docker_image_pusher/
lib.rs

1//! Docker Image Pusher
2//!
3//! `docker-image-pusher` is a command-line tool and library for pushing Docker image tar packages directly to Docker registries (including Docker Hub, Harbor, and private registries) with advanced chunked upload support, robust digest validation, and detailed error reporting.
4//!
5//! ## Features
6//! - **Direct push of Docker/Podman image tarballs**: No need to load images into a local daemon.
7//! - **Chunked and parallel upload**: Efficiently uploads large layers with retry and progress tracking.
8//! - **Digest validation**: Ensures layer and config digests match Docker/OCI standards.
9//! - **Flexible authentication**: Supports username/password and token-based auth.
10//! - **Comprehensive error handling**: Clear error messages for network, registry, and file issues.
11//! - **Verbose and quiet modes**: Control output for CI or debugging.
12//!
13//! ## Main Modules
14//! - [`cli`] - Command-line interface and argument parsing.
15//! - [`config`] - Configuration and authentication structures.
16//! - [`digest`] - Digest calculation and validation utilities.
17//! - [`error`] - Error types and handlers.
18//! - [`image`] - Image tarball parsing and metadata extraction.
19//! - [`output`] - Structured output and logging.
20//! - [`registry`] - Registry client and authentication.
21//! - [`tar_utils`] - Tarball extraction and layer handling.
22//! - [`upload`] - Upload strategies and progress tracking.
23//!
24//! ## Example Usage
25//!
26//! ```sh
27//! docker save myimage:latest -o myimage.tar
28//! docker-image-pusher --file myimage.tar --repository-url https://my-registry.com/myimage:latest --username user --password pass
29//! ```
30//!
31//! ## Library Usage
32//! This crate can also be used as a library for custom workflows. See the documentation for each module for details.
33
34pub mod cli;
35pub mod config;
36pub mod digest; // 新增的digest工具模块
37pub mod error;
38pub mod image;
39pub mod output;
40pub mod registry;
41pub mod tar_utils; // Shared tar processing utilities
42pub mod upload;
43
44pub use config::AuthConfig;
45pub use digest::DigestUtils;
46pub use error::{PusherError, Result};
47pub use output::OutputManager; // 导出digest工具