Automated Docker container management with intelligent upstream monitoring and CI/CD workflows. Built following programming best practices with shared utilities, focused components, and comprehensive testing.
This repository maintains 9 production-ready Docker containers with automated version monitoring, smart builds, and deployment pipelines. Each container includes version detection, health checks, and standardized build processes using shared utilities and focused scripts following DRY, SOLID, and KISS principles.
docker-containers/
βββ .github/
β βββ workflows/ # GitHub Actions workflows
β β βββ upstream-monitor.yaml # Upstream version monitoring
β β βββ auto-build.yaml # Automated container builds
β β βββ validate-version-scripts.yaml
β βββ actions/ # Reusable GitHub Actions
βββ make # Universal build coordinator (simplified)
βββ scripts/ # Focused utility scripts (Single Responsibility)
β βββ build-container.sh # Container building logic
β βββ push-container.sh # Registry push operations
β βββ check-version.sh # Version detection utilities
βββ helpers/ # Shared utilities (DRY principle)
β βββ logging.sh # Centralized logging functions
β βββ docker-registry # Registry interaction utilities
βββ CHANGELOG.md # Build history timeline
βββ audit-containers.sh # Container audit tool
βββ test-all-containers.sh # Comprehensive testing
βββ validate-version-scripts.sh # Version script validation
βββ [containers]/ # Production containers
βββ ansible/ # Configuration management
βββ debian/ # Base Debian images
βββ openresty/ # Web server with Lua
βββ openvpn/ # VPN server
βββ php/ # PHP runtime environment
βββ postgres/ # Database server
βββ sslh/ # SSL/SSH multiplexer
βββ terraform/ # Infrastructure as code
βββ wordpress/ # CMS platform
βββ [container-name]/ # Standard structure
βββ Dockerfile # Container definition
βββ version.sh # Version management script
βββ docker-compose.yml # Optional compose config
βββ README.md # Container documentation
This repository follows industry-standard programming principles for maintainable, scalable code:
- Shared Utilities:
helpers/logging.sh
eliminates ~200 lines of duplicate logging code - Centralized Functions: Single source of truth for common operations
- Consistent APIs: Standardized interfaces across all scripts
- Single Responsibility: Each script in
scripts/
has one focused purpose - Decomposed Architecture: Monolithic make script broken into focused utilities
- Clear Interfaces: Well-defined inputs and outputs for all functions
- Simplified Workflows: Complex operations broken into understandable steps
- Minimal Dependencies: Leveraging shell built-ins and existing tools
- Clear Documentation: Straightforward explanations and examples
- Robust Error Handling: Graceful failure handling with clear error messages
- Input Validation: All user inputs validated before processing
- Comprehensive Testing: 100% success rate across all validation scripts
- Automated Monitoring: Twice-daily upstream version checks with intelligent PR creation
- Smart Build System: Simplified universal make script with focused utility components
- Version Management: Standardized version.sh scripts with multiple source strategies
- CI/CD Integration: GitHub Actions workflows for building, testing, and deployment
- Security: Health checks, non-root users, and automated security updates
- Shared Utilities: DRY principle implementation with centralized logging and helper functions
- Quality Assurance: Comprehensive testing with 100% success rate (9/9 containers)
- ansible/ - Configuration management and automation platform
- terraform/ - Infrastructure as code with Terraform CLI
- openvpn/ - OpenVPN server for secure networking
- wordpress/ - WordPress CMS with PHP optimization
- sslh/ - SSL/SSH multiplexer for port sharing
- postgres/ - PostgreSQL database with optimization
- elasticsearch-conf/ - Elasticsearch configuration management
- debian/ - Minimal Debian base images with version flexibility
- php/ - PHP development environment with Composer
- logstash/ - Log processing and forwarding
- openresty/ - High-performance web platform (Nginx + Lua)
- es-kopf/ - Elasticsearch management web interface
# Build specific container
./make build wordpress
# Build all containers
./make build
# List available containers
./make targets
# Run container directly
./make run wordpress
# Using docker-compose
cd wordpress && docker-compose up -d
# Check current version
./make version wordpress
# Get latest upstream version
cd wordpress && ./version.sh latest
- Schedule: 6 AM/6 PM UTC daily
- Purpose: Detects upstream version updates and creates PRs
- Manual:
gh workflow run upstream-monitor.yaml --field container=wordpress
- Triggers: Push to main, PRs, schedule, manual dispatch
- Purpose: Builds and pushes containers when changes detected
- Features: Multi-arch builds, registry push, smart detection
- Triggers: Changes to version.sh files
- Purpose: Ensures all version scripts are functional
- Testing:
./validate-version-scripts.sh
- Docker Engine 20.10+
- Docker Compose v2+
- Bash 4.0+
NB: Also works with Podman.
-
Create directory structure:
mkdir my-app && cd my-app
-
Create Dockerfile: Follow existing patterns with health checks and non-root users
-
Create version.sh script (using centralized pattern):
#!/bin/bash source "$(dirname "$0")/../helpers/docker-registry" # Function to get latest upstream version get_latest_upstream() { # Container-specific upstream detection logic # Examples: # latest-docker-tag library/nginx "^[0-9]+\.[0-9]+\.[0-9]+$" # latest-git-tag owner/repo "^v[0-9]+\.[0-9]+\.[0-9]+$" # get_pypi_latest_version package-name } # Use standardized version handling handle_version_request "$1" "oorabona/my-app" "^[0-9]+\.[0-9]+\.[0-9]+$" "get_latest_upstream"
-
Test locally:
chmod +x version.sh cd .. && ./make build my-app
# Test all version scripts
./validate-version-scripts.sh
# Test GitHub Actions locally
./test-github-actions.sh
# Build and test specific container
./make build wordpress && ./make run wordpress
- GitHub Actions Guide - Workflow and action references
- Local Development - Development setup and workflows
- Testing Guide - Local testing with GitHub Actions
- Security Policy - Security guidelines and reporting
- Dashboard - Auto-generated container status (updated automatically)
- Fork and create feature branch
- Follow existing patterns for new containers
- Test locally with
./test-github-actions.sh
- Submit PR with clear description
- Issues: GitHub Issues
- Security: See SECURITY.md
MIT License - see LICENSE file for details.