Sign inSign up

mildman1848/rclone

By mildman1848

•Updated about 1 year ago

Production-ready rclone Docker image based on LinuxServer.io Alpine with S6 Overlay and security har

Image
0

2.1K

mildman1848/rclone repository overview

⁠rclone Docker Image

šŸ“– Deutsche Version⁠ | šŸ‡¬šŸ‡§ English Version

Build Status Docker Pulls Docker Image Size License Version

🐳 Docker Hub: mildman1848/rclone⁠

A production-ready Docker image for rclone⁠ based on the LinuxServer.io Alpine baseimage with enhanced security features, automatic secret management, full LinuxServer.io compliance, and CI/CD integration. rclone is a command-line program to manage files on cloud storage.

ā šŸš€ Features

  • āœ… LinuxServer.io Alpine Baseimage 3.22 - Optimized and secure
  • āœ… S6 Overlay v3 - Professional process management
  • āœ… Full LinuxServer.io Compliance - FILE__ secrets, Docker Mods, custom scripts
  • āœ… Enhanced Security Hardening - Non-root execution, capability dropping, secure permissions
  • āœ… OCI Manifest Lists - True multi-architecture support following OCI standard
  • āœ… LinuxServer.io Pipeline - Architecture-specific tags + manifest lists
  • āœ… Multi-Platform Support - AMD64, ARM64 with native performance
  • āœ… Advanced Health Checks - Automatic monitoring with failover
  • āœ… Robust Secret Management - 512-bit JWT, 256-bit API keys, secure rotation
  • āœ… Automated Build System - Make + GitHub Actions CI/CD with manifest validation
  • āœ… Environment Validation - Comprehensive configuration checks
  • āœ… Security Scanning - Integrated vulnerability scans with Trivy + CodeQL
  • āœ… OCI Compliance - Standard-compliant container labels and manifest structure

ā šŸš€ Quick Start

# Clone repository
git clone https://github.com/mildman1848/rclone.git
cd rclone

# Complete setup (environment + secrets)
make setup

# Start container
docker-compose up -d
⁠With Docker Compose (Manual)
# Clone repository
git clone https://github.com/mildman1848/rclone.git
cd rclone

# Configure environment
cp .env.example .env
# Adjust .env as needed

# Generate secure secrets
make secrets-generate

# Start container (docker-compose.override.yml provides security hardening)
docker-compose up -d
⁠With Docker Run
docker run -d \
  --name rclone \
  -p 5572:5572 \
  -v /path/to/config:/config \
  -v /path/to/data:/data \
  -e PUID=1000 \
  -e PGID=1000 \
  -e TZ=Europe/Berlin \
  --restart unless-stopped \
  mildman1848/rclone:latest

ā šŸ› ļø Build & Development

⁠Makefile Targets
# Show help
make help

# Complete setup
make setup                   # Initial setup (env + secrets)
make env-setup               # Create environment from .env.example
make env-validate            # Validate environment

# Secret Management (Enhanced)
make secrets-generate        # Generate secure secrets (512-bit JWT, 256-bit API)
make secrets-rotate          # Rotate secrets (with backup)
make secrets-clean           # Clean up old secret backups
make secrets-info            # Show secret status

# Build & Test (Enhanced with OCI Manifest Lists)
make build                   # Build image for current platform
make build-multiarch         # Multi-architecture build (legacy)
make build-manifest          # LinuxServer.io style manifest lists (recommended)
make inspect-manifest        # Inspect manifest lists (multi-arch details)
make validate-manifest       # Validate OCI manifest compliance
make test                    # Test container (with health checks)
make security-scan           # Run comprehensive security scan (Trivy + CodeQL)
make trivy-scan              # Run Trivy vulnerability scan only
make codeql-scan             # Run CodeQL static code analysis
make validate                # Validate Dockerfile

# Container Management
make start                   # Start container
make stop                    # Stop container
make restart                 # Restart container
make status                  # Show container status and health
make logs                    # Show container logs
make shell                   # Open shell in container

# Development
make dev                     # Start development container

# Release
make release                 # Complete release workflow
make push                    # Push image to registry
⁠Manual Build
# Build image
docker build -t mildman1848/rclone:latest .

# With specific arguments
docker build \
  --build-arg RCLONE_VERSION=v1.71.0 \
  --build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
  -t mildman1848/rclone:latest .
⁠Production Deployment
# Use production configuration with enhanced security
docker-compose -f docker-compose.yml -f docker-compose.production.yml up -d

# Or use the override file for automatic security hardening
docker-compose up -d  # Automatically applies docker-compose.override.yml

ā āš™ļø Configuration

⁠Environment File

Configuration is done via a .env file containing all environment variables:

# Create .env from template
cp .env.example .env

# Adjust values as needed
nano .env

The .env.example contains all available options with documentation and links to the official rclone documentation.

⁠Important Environment Variables
VariableDefaultDescription
PUID1000User ID for file permissions
PGID1000Group ID for file permissions
TZEurope/BerlinTimezone
PORT5572Internal container port (rclone Web GUI)
EXTERNAL_PORT5572External host port (rclone Web GUI)
CONFIG_PATH/configConfiguration path in container
DATA_PATH/dataData path in container
LOG_LEVELinfoLog level (debug, info, warn, error)
RCLONE_MODErcdrclone operation mode (rcd/serve)
RCLONE_CONFIG/config/rclone/rclone.confrclone configuration file
RCLONE_LOG_LEVELINFOrclone log level (DEBUG, INFO, NOTICE, ERROR)

šŸ“– Full Documentation: See .env.example⁠ for all available options

ā šŸ” Enhanced LinuxServer.io Secrets Management

FILE__ Prefix (Recommended): The image supports the LinuxServer.io standard FILE__ prefix for secure secret management:

# .env file - FILE__ prefix secrets for rclone
FILE__RCLONE_CONFIG_PASS=/run/secrets/rclone_config_pass
FILE__RCLONE_WEB_GUI_PASSWORD=/run/secrets/rclone_web_pass
FILE__RCLONE_PASSWORD=/run/secrets/rclone_password

# Docker Compose example
environment:
  - FILE__RCLONE_CONFIG_PASS=/run/secrets/rclone_config_pass
  - FILE__RCLONE_WEB_GUI_PASSWORD=/run/secrets/rclone_web_pass

Enhanced Secret Generation:

# Secure secret generation (improved algorithms)
make secrets-generate        # 512-bit JWT, 256-bit API keys

# Secret rotation with backup
make secrets-rotate

# Check secret status
make secrets-info

Supported Secrets (rclone-specific):

FILE__ VariableDescriptionSecurityMake Generated
FILE__RCLONE_CONFIG_PASSrclone config encryption passwordāœ… Highāœ…
FILE__RCLONE_WEB_GUI_PASSWORDrclone Web GUI passwordāœ… Highāœ…
FILE__RCLONE_PASSWORDrclone authentication passwordāœ… Highāœ…
FILE__SESSION_SECRETSession secret (256-bit)āœ… Highāœ…
FILE__BACKUP_KEYBackup encryption keyāœ… Highāœ…

šŸ“– LinuxServer.io Documentation: FILE__ Prefix⁠

⁠Volumes
Container PathDescription
/configrclone configuration files, cache, and logs
/dataCloud storage mount points and data
⁠rclone Operation Modes

The container supports two primary operation modes:

⁠1. rcd Mode (Default) - Remote Control Daemon with Web GUI
  • Port: 5572 (official rclone Web GUI port)
  • Features: Full Web-based management interface
  • Access: http://localhost:5572⁠
  • Configuration: RCLONE_MODE=rcd
⁠2. serve Mode - File Server
  • Port: Configurable (default 5572)
  • Features: File serving with optional Web GUI
  • Protocols: http, webdav, ftp, sftp
  • Configuration: RCLONE_MODE=serve
# rcd mode (Web GUI) - Default
RCLONE_MODE=rcd

# serve mode (File Server)
RCLONE_MODE=serve
RCLONE_SERVE_PROTOCOL=http  # or webdav, ftp, sftp

ā šŸ”§ Enhanced LinuxServer.io S6 Overlay Services

The image uses S6 Overlay v3 with optimized services following LinuxServer.io standards:

  • init-branding - Custom Mildman1848 ASCII art branding
  • init-mods-package-install - Docker Mods installation
  • init-custom-files - Custom scripts & UMASK setup
  • init-secrets - Enhanced FILE__ prefix & legacy secret processing
  • init-rclone-config - rclone configuration with validation
  • rclone - Main application with correct parameter passing
⁠Service Dependencies (Fixed)
init-branding → init-mods-package-install → init-custom-files → init-secrets → init-rclone-config → rclone
⁠Service Improvements
  • āœ… Secure Permissions - Fallback methods for chmod issues
  • āœ… Enhanced Validation - JSON config validation
  • āœ… Robust Error Handling - Graceful fallbacks on errors
  • āœ… Security Hardening - Path validation for FILE__ secrets
⁠LinuxServer.io Features

Docker Mods Support:

# Single mod
DOCKER_MODS=linuxserver/mods:universal-cron

# Multiple mods (separated by |)
DOCKER_MODS=linuxserver/mods:universal-cron|linuxserver/mods:rclone-custom

Custom Scripts:

# Scripts in /custom-cont-init.d are executed before services
docker run -v ./my-scripts:/custom-cont-init.d:ro mildman1848/rclone

UMASK Support:

# Default: 022 (files: 644, directories: 755)
UMASK=022

šŸ“– Available Mods: mods.linuxserver.io⁠

ā šŸ”’ Enhanced Security

šŸ›”ļø Security Policy: See our Security Policy⁠ for reporting vulnerabilities and security guidelines

⁠Advanced Security Hardening

The image implements comprehensive security measures:

  • āœ… Non-root Execution - Container runs as user abc (UID 911)
  • āœ… Capability Dropping - ALL capabilities dropped, minimal required added
  • āœ… no-new-privileges - Prevents privilege escalation
  • āœ… Secure File Permissions - 750 for directories, 640 for files
  • āœ… Path Validation - FILE__ secret path sanitization
  • āœ… Enhanced Error Handling - Secure fallbacks for permission issues
  • āœ… tmpfs Mounts - Temporary files in memory
  • āœ… Security Opt - Additional kernel security features
  • āœ… Robust Secret Handling - 512-bit encryption, secure rotation
⁠Security Scanning & Vulnerability Management

Latest Security Improvements (September 2025):

  • āœ… 68% Vulnerability Reduction - From 28 to 9 vulnerabilities through comprehensive npm package updates
  • āœ… CodeQL Integration - Static code analysis for JavaScript/TypeScript
  • āœ… Enhanced npm Security - Updated 16+ vulnerable packages (axios, express, cookie, etc.)
  • āœ… Automated Scanning - GitHub Actions integration for continuous security monitoring
# Comprehensive security scan (Trivy + CodeQL)
make security-scan

# Individual scanning tools
make trivy-scan              # Vulnerability scanning only
make codeql-scan             # Static code analysis only
make security-scan-detailed  # Detailed scan with exports

# Manual scanning
trivy image mildman1848/rclone:latest
trivy fs --format sarif --output trivy-results.sarif .

# Dockerfile validation
make validate
⁠Docker Security Best Practices

Implemented Security Features:

  • āœ… docker-compose.override.yml - Automatic security hardening
  • āœ… docker-compose.production.yml - Production-ready configuration
  • āœ… seccomp-profile.json - Custom syscall filtering
  • āœ… Capability dropping - Minimal required privileges
  • āœ… Non-root execution - User abc (UID 911)
  • āœ… Resource limits - CPU, memory, and PID constraints
  • āœ… Network isolation - Custom bridge networks
  • āœ… tmpfs mounts - Temporary files in memory
  • āœ… Read-only filesystems where applicable
# 1. Use LinuxServer.io FILE__ secrets for rclone
FILE__RCLONE_CONFIG_PASS=/run/secrets/rclone_config_pass
FILE__RCLONE_WEB_GUI_PASSWORD=/run/secrets/rclone_web_pass
FILE__RCLONE_PASSWORD=/run/secrets/rclone_password

# 2. Set host user IDs (LinuxServer.io standard)
export PUID=$(id -u)
export PGID=$(id -g)

# 3. Use restrictive UMASK for production
export UMASK=027  # More secure than default 022

# 4. Secure secret generation
make secrets-generate

# 5. Validate configuration
make env-validate

# 6. Use specific image tags
docker run mildman1848/rclone:v1.71.0  # instead of :latest

# 7. Monitor container health
make status  # Container status and health checks

# 8. Production deployment with maximum security
docker-compose -f docker-compose.yml -f docker-compose.production.yml up -d

# 9. Development with automatic security hardening
docker-compose up -d  # Uses docker-compose.override.yml automatically

# 10. Use custom seccomp profile for syscall filtering
# Automatically applied in docker-compose.production.yml
⁠OCI Manifest Lists & LinuxServer.io Pipeline

OCI-compliant Multi-Architecture Support:

# Automatic platform detection (Docker pulls the right image)
docker pull mildman1848/rclone:latest

# Platform-specific tags (LinuxServer.io style)
docker pull mildman1848/rclone:amd64-latest    # Intel/AMD 64-bit
docker pull mildman1848/rclone:arm64-latest    # ARM 64-bit (Apple M1, Pi 4)

# Inspect manifest lists
make inspect-manifest
docker manifest inspect mildman1848/rclone:latest

Technical Details:

  • āœ… OCI Image Manifest Specification v1.1.0 compliant
  • āœ… LinuxServer.io Pipeline Standards - Architecture tags + manifest lists
  • āœ… Native Performance - No emulation, real platform builds
  • āœ… Automatic Platform Selection - Docker chooses optimal image
  • āœ… Backward Compatibility - Works with all Docker clients

Manifest Structure:

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
  "manifests": [
    {
      "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
      "platform": { "architecture": "amd64", "os": "linux" }
    },
    {
      "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
      "platform": { "architecture": "arm64", "os": "linux" }
    }
  ]
}
⁠LinuxServer.io Compatibility
# Fully compatible with LinuxServer.io standards
# āœ… S6 Overlay v3
# āœ… FILE__ Prefix Secrets
# āœ… DOCKER_MODS Support
# āœ… Custom Scripts (/custom-cont-init.d)
# āœ… UMASK Support
# āœ… PUID/PGID Management
# āœ… Custom Branding (LinuxServer.io compliant)
# āœ… OCI Manifest Lists (2024 Pipeline Standard)
ā šŸŽØ Container Branding

The container shows a custom ASCII-art branding for "Mildman1848" at startup:

ā–ˆā–ˆā–ˆā•—   ā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā•—ā–ˆā–ˆā•—     ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•—   ā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā•—   ā–ˆā–ˆā•— ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā•—  ā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā–ˆā•—
ā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘     ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā•— ā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā•—  ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā–ˆā–ˆā•‘  ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—
ā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘     ā–ˆā–ˆā•‘  ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā–ˆā–ˆā–ˆā–ˆā•”ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā–ˆā–ˆā•— ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•
ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘     ā–ˆā–ˆā•‘  ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā•—ā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—ā•šā•ā•ā•ā•ā–ˆā–ˆā•‘ā–ˆā–ˆā•”ā•ā•ā–ˆā–ˆā•—
ā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•—ā–ˆā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•ā–ˆā–ˆā•‘ ā•šā•ā• ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘  ā–ˆā–ˆā•‘ā–ˆā–ˆā•‘ ā•šā–ˆā–ˆā–ˆā–ˆā•‘ ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•     ā–ˆā–ˆā•‘ā•šā–ˆā–ˆā–ˆā–ˆā–ˆā•”ā•
ā•šā•ā•     ā•šā•ā•ā•šā•ā•ā•šā•ā•ā•ā•ā•ā•ā•ā•šā•ā•ā•ā•ā•ā• ā•šā•ā•     ā•šā•ā•ā•šā•ā•  ā•šā•ā•ā•šā•ā•  ā•šā•ā•ā•ā• ā•šā•ā• ā•šā•ā•ā•ā•ā•      ā•šā•ā• ā•šā•ā•ā•ā•ā•

Branding Features:

  • āœ… LinuxServer.io Compliance - Correct branding implementation
  • āœ… Custom ASCII Art - Unique Mildman1848 representation
  • āœ… Version Information - Build details and rclone version
  • āœ… Support Links - Clear references for help and documentation
  • āœ… Feature Overview - Overview of implemented LinuxServer.io features

āš ļø Note: This container is NOT officially supported by LinuxServer.io

⁠Monitoring & Health Checks

⁠Health Check

The image includes automatic health checks:

# Check status
docker inspect --format='{{.State.Health.Status}}' rclone

# Show logs
docker logs rclone
⁠rclone Monitoring

Built-in Monitoring:

  • Health checks via process validation
  • Container status monitoring
  • Log aggregation

rclone Web GUI (rcd mode):

  • Real-time transfer monitoring
  • Configuration management
  • File browser interface

Prometheus Metrics (Optional): rclone can export Prometheus metrics when configured with --rc-enable-metrics. See rclone documentation⁠ for details.

# Enable Prometheus metrics
RCLONE_RC_ENABLE_METRICS=true
# Access metrics at http://localhost:5572/metrics

ā šŸ“ Configuration Files

FilePurposeUsage
docker-compose.ymlBase configurationStandard deployment
docker-compose.override.ymlSecurity hardeningAutomatically applied
docker-compose.production.ymlProduction configdocker-compose -f docker-compose.yml -f docker-compose.production.yml up -d
seccomp-profile.jsonSyscall filteringEnhanced security (production)
.env.exampleEnvironment templateCopy to .env and customize

ā šŸ”§ Troubleshooting

⁠Common Issues
File Permissions
# Adjust PUID/PGID to host user
export PUID=$(id -u)
export PGID=$(id -g)
docker-compose up -d

# Or set in .env
echo "PUID=$(id -u)" >> .env
echo "PGID=$(id -g)" >> .env
Port Already in Use
# Change port in .env
echo "EXTERNAL_PORT=13379" >> .env

# Or directly in docker-compose.yml
ports:
  - "13379:5572"
Container Won't Start
# 1. Check logs
make logs

# 2. Health check status
docker inspect --format='{{.State.Health.Status}}' rclone

# 3. Validate environment
make env-validate

# 4. Debug shell
make shell
Secrets Not Found
# Use LinuxServer.io FILE__ secrets
echo "FILE__JWT_SECRET=/run/secrets/jwt_secret" >> .env

# Generate legacy secrets
make secrets-generate

# Check secret status
make secrets-info

# Manual FILE__ secret creation
mkdir -p secrets
openssl rand -base64 64 > secrets/jwt_secret.txt
echo "FILE__JWT_SECRET=$(pwd)/secrets/jwt_secret.txt" >> .env
⁠Debug Mode
# Development container with debug logging
echo "LOG_LEVEL=debug" >> .env
echo "DEBUG_MODE=true" >> .env
echo "VERBOSE_LOGGING=true" >> .env
make dev

# Shell access
make shell

# Container inspection
docker exec -it rclone /bin/bash

ā šŸ¤ Contributing

⁠Development Workflow
  1. Fork & Clone

    git clone https://github.com/yourusername/rclone.git
    cd rclone
    
  2. Setup Development Environment

    make setup
    make dev
    
  3. Make Changes & Test

    make validate      # Dockerfile linting
    make build         # Build image
    make test          # Run tests
    make security-scan # Security check
    
  4. Submit PR

    • Create a feature branch
    • Test all changes
    • Create a pull request

šŸ›”ļø Security Issues: Please read our Security Policy⁠ before reporting security vulnerabilities

⁠CI/CD Pipeline

The project uses GitHub Actions for:

  • āœ… Automated Testing - Dockerfile, container, integration tests
  • āœ… Security Scanning - Trivy, Hadolint, SBOM generation
  • āœ… OCI Manifest Lists - LinuxServer.io pipeline with architecture-specific tags
  • āœ… Multi-Architecture Builds - AMD64, ARM64 with native performance
  • āœ… Manifest Validation - OCI compliance and platform verification
  • āœ… Automated Releases - Semantic versioning, Docker Hub/GHCR
  • āœ… Dependency Updates - Dependabot integration
  • āœ… Upstream Monitoring - Automated dependency tracking and update notifications
ā šŸ”„ Upstream Dependency Monitoring

The project includes automated monitoring of upstream dependencies:

  • rclone Application: Monitors rclone/rclone⁠ releases
  • LinuxServer.io Base Image: Tracks linuxserver/docker-baseimage-alpine⁠ updates
  • Automated Notifications: Creates GitHub issues for new releases
  • Security Assessment: Prioritizes security-related updates
  • Semi-Automated: rclone updates via PR, base image updates require manual review

Monitoring Schedule: Monday and Thursday at 6 AM UTC

See UPSTREAM_AUTOMATION_EVALUATION.md⁠ for detailed implementation strategy.

ā šŸ”§ Setup Requirements

For GHCR (GitHub Container Registry) support:

  • Create a Personal Access Token with write:packages and read:packages scopes
  • Add as repository secret: GHCR_TOKEN
  • Path: Repository Settings → Secrets and variables → Actions → New repository secret

All other workflows work without additional setup.

⁠License

This project is licensed under the MIT License. See LICENSE⁠ for details.

⁠Acknowledgments

Tag summary

Content type

Image

Digest

sha256:94f691858…

Size

33.3 MB

Last updated

about 1 year ago

docker pull mildman1848/rclone