Docker Image Pusher
A high-performance command-line tool written in Rust for pushing Docker image tar packages directly to Docker registries. Designed for enterprise environments and offline deployments, it efficiently handles large images (>10GB) through intelligent chunked uploads and concurrent processing.
π¨π³ δΈζζζ‘£
β¨ Key Features
- π High Performance: Multi-threaded chunked uploads with configurable concurrency
- π¦ Large Image Support: Optimized for images larger than 10GB with resume capability
- π Enterprise Security: Comprehensive authentication support including token management
- π Multi-Registry: Compatible with Docker Hub, Harbor, AWS ECR, Google GCR, Azure ACR
- π Progress Tracking: Real-time upload progress with detailed feedback
- π‘οΈ Robust Error Handling: Automatic retry mechanisms and graceful failure recovery
- βοΈ Flexible Configuration: Environment variables, config files, and CLI arguments
- π Resume Support: Resume interrupted uploads automatically
- π― Dry Run Mode: Validate configurations without actual uploads
π― Use Cases
Enterprise & Production Environments
- Air-Gapped Deployments: Transfer images to internal registries without internet access
- Security Compliance: Meet data sovereignty and security audit requirements
- Edge Computing: Deploy to remote locations with limited connectivity
- CI/CD Pipelines: Automate image transfers between development and production environments
- Disaster Recovery: Backup and restore critical container images
π₯ Installation
Option 1: Download Pre-built Binary
Download from GitHub Releases:
# Linux x64
# macOS Intel
# macOS Apple Silicon
# Windows (PowerShell)
Option 2: Install via Cargo
Option 3: Build from Source
# Binary will be at ./target/release/docker-image-pusher
π Quick Start
Basic Usage
# Simple push with authentication
Common Workflow
# 1. Export image from Docker
# 2. Push to private registry
π Command Reference
Core Arguments
| Short | Long | Description | Required | Example |
|---|---|---|---|---|
-f |
--file |
Docker image tar file path | β | /path/to/image.tar |
-r |
--repository-url |
Full repository URL | β | https://registry.com/app:v1.0 |
-u |
--username |
Registry username | β οΈ | admin |
-p |
--password |
Registry password | β οΈ | secret123 |
Configuration Options
| Short | Long | Description | Default | Example |
|---|---|---|---|---|
-t |
--timeout |
Network timeout (seconds) | 7200 |
3600 |
--large-layer-threshold |
Large layer threshold (bytes) | 1073741824 |
2147483648 |
|
--max-concurrent |
Maximum concurrent uploads | 1 |
4 |
|
--retry-attempts |
Number of retry attempts | 3 |
5 |
Control Flags
| Long | Description | Usage |
|---|---|---|
--skip-tls |
Skip TLS certificate verification | For self-signed certificates |
--verbose |
Enable detailed output | Debugging and monitoring |
--quiet |
Suppress all output except errors | Automated scripts |
--dry-run |
Validate without uploading | Configuration testing |
--skip-existing |
Skip uploading layers that already exist | Resume interrupted uploads |
--force-upload |
Force upload even if layers exist | Overwrite existing layers |
Advanced Examples
Large Image Optimization
# Optimized for 15GB PyTorch model
Enterprise Harbor Registry
# Production deployment to Harbor
Resume Interrupted Upload
# Resume upload that was previously interrupted
Force Complete Re-upload
# Force complete re-upload of all layers
Batch Processing Script
#!/bin/bash
# Process multiple images with error handling
REGISTRY_BASE="https://registry.internal.com/apps"
FAILED_IMAGES=()
for; do
image_name=
if ; then
else
FAILED_IMAGES+=("")
fi
done
# Report results
if [; then
else
fi
π§ Configuration
Environment Variables
Set credentials and defaults via environment variables:
# Authentication
# Configuration
# Simplified command
Performance Tuning
Network-Optimized Settings
# For slow/unstable networks (< 10 Mbps)
High-Speed Network Settings
# For fast, stable networks (> 100 Mbps)
π’ Enterprise Scenarios
Financial Services - Air-Gapped Deployment
# Development environment
# Production environment (after secure transfer)
Manufacturing - Edge Computing
# Deploy to factory edge nodes with limited bandwidth
Healthcare - Compliance Environment
# HIPAA-compliant image deployment
π Troubleshooting
Common Issues and Solutions
Authentication Failures
# Test credentials with dry run
Common causes:
- Expired credentials
- Insufficient registry permissions
- Registry-specific authentication requirements
Certificate Issues
# For self-signed certificates
Security note: Only use --skip-tls in trusted networks.
Large File Upload Failures
# Optimized settings for large files
Network Timeout Issues
# For unstable networks
Debug Information
Enable verbose logging to get detailed information:
|
The verbose output includes:
- Layer extraction progress
- Upload attempt details
- Retry information
- Network timing
- Registry responses
π Performance Benchmarks
Typical Performance Metrics
| Image Size | Network | Time | Concurrency | Settings |
|---|---|---|---|---|
| 500MB | 100 Mbps | 45s | 2 | Default |
| 2GB | 100 Mbps | 3m 20s | 4 | Optimized |
| 10GB | 1 Gbps | 8m 15s | 4 | High-speed |
| 25GB | 100 Mbps | 45m 30s | 2 | Large image |
Optimization Tips
- Concurrency: Start with 2-4 concurrent uploads
- Timeouts: Set based on your network stability
- Retries: Higher for unstable networks
- Large Layer Threshold: Adjust based on typical layer sizes
π€ Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
Running Tests
# Unit tests
# Integration tests with Docker registry
# Performance benchmarks
Code Quality
# Format code
# Run linter
# Security audit
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Support
- π Documentation
- π Report Issues
- π¬ Discussions
- π§ Email: yorelog@gmail.com
π Acknowledgments
- Docker Registry HTTP API V2 specification
- Rust community for excellent crates
- All contributors and users providing feedback
β οΈ Security Notice: Always use secure authentication methods in production. Consider using environment variables, credential files, or secure vaults instead of command-line arguments for sensitive information.
π Performance Tip: For optimal performance, test different concurrency settings with your specific network and registry setup.