Skip to content

πŸ—„οΈ High-performance Docker volume backup tool with configurable compression and JSON/text output

License

Notifications You must be signed in to change notification settings

ErcinDedeoglu/packmate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

47 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ—„οΈ PackMate

A high-performance, Docker-ready archiving tool for backing up Docker volumes and directories

Docker Pulls Docker Image Size

πŸš€ Features

  • Performance:

    • Fast & Efficient: Optimized for handling large datasets with minimal resource usage
    • Safe Operations: Read-only source handling and comprehensive error reporting
  • Flexibility:

    • Configurable Compression: Choose between no compression for speed or maximum compression for space savings
    • Advanced Parameters: Support for custom compression methods, multi-volume archives, encryption, and more
  • Output Options:

    • Multiple Output Formats: Support for both JSON and human-readable outputs
    • Custom Naming: Flexible archive naming options
  • Docker Integration:

    • Purpose-built for Docker volume backups
    • Minimal container footprint with Alpine-based secure base image

πŸ“‹ Usage

PackMate provides a simple CLI interface for creating archives. Below are examples and parameter details to help you get started.

⚑ Quick Start

docker run --rm \
  -v /your/source/path:/source:ro \
  -v /your/backup/path:/output \
  dublok/packmate:latest \
  --name "backup-$(date +%Y%m%d)"

🎯 Parameters

Parameter Description Required Default
--source Source directory to archive Yes /source
--output Output directory for the archive Yes /output
--name Custom name for the archive file No Base64 encoded path
--compression Compression level (0: none, 1: fastest, 9: best compression) No 5
--method Compression method (copy, lzma2, ppmd, etc.) No lzma2
--password Password for encrypting the archive No None
--header-encryption Enable header encryption No false
--volume-size Create multi-volume archive with specified size (e.g., 100m) No None
--multithreading Enable multithreading for faster compression No true
--extra Additional p7zip flags (e.g., -ms=off) No None
--format Output format (json or text) No json

πŸ“Š Compression Levels

Level Description Use Case
0 No compression Fastest, best for already compressed data
1 Best speed Good balance for compressible data
5 Default compression Balanced speed and compression ratio
9 Best compression Smallest file size, slower compression

πŸ” Encryption Options

Parameter Description
--password Encrypt the archive with a password
--header-encryption Encrypt the archive headers for additional security

πŸ“¦ Multi-Volume Archives

Use the --volume-size parameter to split the archive into multiple files:

--volume-size=100m  # Creates 100 MB volumes

πŸ’‘ Examples

Basic Backup (No Compression)

docker run --rm \
  -v /var/lib/docker/volumes/myapp_data/_data:/source:ro \
  -v /backup:/output \
  dublok/packmate:latest \
  --name "backup-$(date +%Y%m%d)" \
  --compression=0 \
  --method=copy

Maximum Compression Backup

docker run --rm \
  -v /var/lib/docker/volumes/myapp_data/_data:/source:ro \
  -v /backup:/output \
  dublok/packmate:latest \
  --name "backup-$(date +%Y%m%d)" \
  --compression=9 \
  --method=lzma2

Encrypted Backup

docker run --rm \
  -v /var/lib/docker/volumes/myapp_data/_data:/source:ro \
  -v /backup:/output \
  dublok/packmate:latest \
  --name "backup-$(date +%Y%m%d)" \
  --compression=5 \
  --method=lzma2 \
  --password=secret \
  --header-encryption

Multi-Volume Archive

docker run --rm \
  -v /var/lib/docker/volumes/myapp_data/_data:/source:ro \
  -v /backup:/output \
  dublok/packmate:latest \
  --name "backup-$(date +%Y%m%d)" \
  --compression=5 \
  --method=lzma2 \
  --volume-size=100m

Fastest Archiving (No Compression, No Solid Mode)

docker run --rm \
  -v /var/lib/docker/volumes/myapp_data/_data:/source:ro \
  -v /backup:/output \
  dublok/packmate:latest \
  --name "backup-$(date +%Y%m%d)" \
  --compression=0 \
  --method=copy \
  --multithreading=true \
  --extra="-ms=off"

πŸ“€ Output Examples

JSON Format

{
  "path": "/source",
  "archivePath": "/output/backup-20250221.7z",
  "status": "Success",
  "compressionLevel": 0,
  "error": ""
}

Text Format

Archive Creation Result:
=======================
βœ… Path: /source
   Archive: /output/backup-20250221.7z
   Compression Level: 0
   Status: Success

πŸ”’ Security Features

  • Source volumes mounted read-only (ro)
  • No root privileges required
  • Minimal container footprint
  • Alpine-based secure base image

πŸ—οΈ Building from Source

# Build the Docker image
docker build -t packmate:latest -f src/Dockerfile src

# Optional: Tag and push to your registry
docker tag packmate:latest your-registry/packmate:latest
docker push your-registry/packmate:latest

βš™οΈ Technical Specifications

  • Go 1.23+
  • Alpine Linux base
  • Uses p7zip for .7z archive creation
  • No external runtime dependencies
  • Efficient buffering for large files
  • Minimal memory footprint
  • Multi-stage Docker builds

πŸ“« Contact & Support

LinkedIn GitHub
If you find this project useful, please consider giving it a ⭐


Made with ❀️ by Ercin Dedeoglu