https://github.com/ercindedeoglu/packmate
🗄️ High-performance Docker volume backup tool with configurable compression and JSON/text output
https://github.com/ercindedeoglu/packmate
archiver backup backup-tool compression container devops docker docker-volume golang zip
Last synced: about 2 months ago
JSON representation
🗄️ High-performance Docker volume backup tool with configurable compression and JSON/text output
- Host: GitHub
- URL: https://github.com/ercindedeoglu/packmate
- Owner: ErcinDedeoglu
- License: gpl-3.0
- Created: 2025-02-20T08:11:57.000Z (over 1 year ago)
- Default Branch: v1.0
- Last Pushed: 2025-07-16T00:30:37.000Z (11 months ago)
- Last Synced: 2025-07-17T01:02:51.002Z (11 months ago)
- Topics: archiver, backup, backup-tool, compression, container, devops, docker, docker-volume, golang, zip
- Language: Go
- Homepage: https://hub.docker.com/r/dublok/packmate
- Size: 4.75 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 🗄️ PackMate
A high-performance, Docker-ready archiving tool for backing up Docker volumes and directories
[](https://hub.docker.com/r/dublok/packmate)
[](https://hub.docker.com/r/dublok/packmate)
## 🚀 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
```bash
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:
```bash
--volume-size=100m # Creates 100 MB volumes
```
## 💡 Examples
### Basic Backup (No Compression)
```bash
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
```bash
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
```bash
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
```bash
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)
```bash
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
```json
{
"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
```bash
# 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
[](https://www.linkedin.com/in/ercindedeoglu/)
[](https://github.com/ErcinDedeoglu)
If you find this project useful, please consider giving it a ⭐
---
Made with ❤️ by [Ercin Dedeoglu](https://github.com/ErcinDedeoglu)