This directory contains comprehensive examples demonstrating how to use the automation-templates Docker build system in various scenarios.
Basic Docker build workflow with minimal configuration.
Features:
- Simple build process
- Basic security scanning
- GHCR.io registry
- No deployment
Use Case: Small applications, proof of concepts, development builds
Complete web application Docker build with testing and deployment.
Features:
- Web-specific optimizations
- Multi-platform builds (AMD64, ARM64)
- Enhanced security scanning (HIGH severity)
- Health checks
- Conditional deployment to staging
- SBOM generation and image signing
Use Case: Production web applications, Node.js apps, React/Vue/Angular frontends
Microservice Docker build with service mesh and comprehensive testing.
Features:
- Microservice-specific patterns
- Helm deployment to Kubernetes
- Service mesh integration (Istio)
- Contract and integration testing
- Monitoring and observability
- Performance optimization
Use Case: Microservice architectures, API services, cloud-native applications
Enterprise-grade Docker build with maximum security and compliance.
Features:
- Compliance validation workflow
- Maximum security (MEDIUM severity threshold)
- Enterprise registry support
- Comprehensive testing suite
- Governance and policy enforcement
- Full observability and monitoring
- Backup and disaster recovery
- Audit logging and compliance reports
Use Case: Enterprise applications, regulated industries, critical systems
Cross-platform Docker build for ARM64, AMD64, and ARM/v7 architectures.
Features:
- Multi-architecture support
- Cross-compilation build arguments
- Platform-specific testing
- Manifest creation
- Optimized caching
Use Case: IoT applications, edge computing, multi-cloud deployment
Security-first Docker build with comprehensive vulnerability scanning.
Features:
- Pre-build security analysis
- Dockerfile security scanning
- Source code security scanning (SAST)
- Very strict security thresholds (LOW severity)
- Security-hardened Docker images
- Comprehensive security reporting
- Automated security issue creation
Use Case: Security-critical applications, financial services, healthcare
Each example uses one of the predefined configuration files:
default.yml- Basic configuration for standard applicationsweb-application.yml- Optimized for web applicationsmicroservice.yml- Microservice-specific configurationenterprise.yml- Maximum security and compliance
-
Choose the appropriate example based on your use case
-
Copy the example file to your repository's
.github/workflows/directory -
Customize the configuration by modifying:
image-name: Your application nameregistry: Your container registrybuild-args: Application-specific build argumentsplatforms: Target platforms for your application- Deployment settings and secrets
-
Configure secrets in your repository:
GITHUB_TOKEN(automatically available)REGISTRY_TOKEN(for custom registries)COSIGN_PRIVATE_KEYandCOSIGN_PASSWORD(for image signing)KUBECONFIG(for Kubernetes deployment)
image-name: 'my-app'
image-tag: ${{ github.ref_name }}-${{ github.sha }}deploy: ${{ github.ref == 'refs/heads/main' }}
deployment-environment: ${{ github.ref == 'refs/heads/main' && 'production' || 'staging' }}platforms: 'linux/amd64,linux/arm64'
multi-platform: truesecurity-scan: true
fail-on-severity: 'HIGH'
generate-sbom: true
sign-image: true- Start Simple: Begin with
simple-docker-build.ymland add features as needed - Security First: Always enable security scanning for production builds
- Image Signing: Use Cosign for production image signing
- SBOM Generation: Generate Software Bill of Materials for compliance
- Multi-Platform: Consider ARM64 support for cloud and edge deployment
- Testing: Include comprehensive testing in your Docker workflows
- Monitoring: Set up proper observability for production deployments
You can customize any example by:
- Modifying the configuration file used (
config-fileparameter) - Creating custom build arguments in the
build-argssection - Adjusting security settings based on your requirements
- Adding custom deployment commands for your infrastructure
- Implementing custom testing strategies
For questions or issues with these examples:
- Check the main workflow file:
.github/workflows/docker-build.yml - Review the action documentation:
.github/actions/docker-build/action.yml - Examine the configuration files in
.github/config/docker-build/ - Create an issue in the automation-templates repository