containers

Container Collection & Automation Framework

A comprehensive collection of Dockerfiles with advanced automation tools for multi-architecture container builds, metrics collection, AI-powered template assistance, and CI/CD workflows.

GitHub Actions License Python Poetry

Overview

This repository provides a comprehensive container development ecosystem featuring:

  • Container Collection: Curated Dockerfiles for Node.js applications and archived Ethereum Parity client
  • Automation Framework: Python scripts for dynamic Dockerfile generation, metrics collection, and image tagging
  • 🧠 AI-Enhanced Template System: Intelligent template recommendations, project analysis, and automated parameter inference
  • Multi-Architecture Support: ARM64 and AMD64 builds with platform-specific optimizations
  • CI/CD Integration: GitHub Actions workflows for building, testing, vulnerability scanning, and publishing
  • Development Environment: Docker-in-Docker devcontainer setup with mise tool management

✨ Features

  • 🐳 Dynamic Dockerfile Generation: Multi-architecture support with customizable base images and packages
  • 🤖 AI-Powered Template Intelligence: Smart recommendations, project analysis, and automated containerization
  • 📊 Container Metrics Collection: Build time, image size, and registry usage analytics
  • 🏷️ Intelligent Image Tagging: Metadata-based tagging with semantic versioning
  • 🔒 Security Integration: Automated vulnerability scanning with Trivy
  • ⚡ Modern Tooling: Poetry, mise-en-place, pre-commit hooks, and automated dependency updates
  • 🚀 CI/CD Workflows: Comprehensive GitHub Actions for container lifecycle management

🧠 AI-Enhanced Features

The container system now includes comprehensive AI capabilities:

Template Intelligence

# Get AI recommendations for your project
poetry run containers ai recommend /path/to/your/project

# Deep project analysis
poetry run containers ai analyze /path/to/your/project --output analysis.md

# Interactive AI assistant
poetry run containers ai chat

Smart Automation

# Automatically infer template parameters
poetry run containers ai infer apps/nodejs/express /my/project

# AI-powered code review
poetry run containers ai review /path/to/code

# Generate intelligent documentation
poetry run containers ai docs --template base/alpine --type readme

Predictive Maintenance

# Analyze template health and usage patterns
poetry run containers ai maintenance --report

# Get optimization suggestions
poetry run containers ai maintenance --template base/alpine

📚 Complete AI Guide – Comprehensive documentation for AI features

📦 Available Containers

Node.js Applications

node/ – Production-ready Node.js container variants:

  • node/release/: Debian Bookworm-based (~160MB) – Full compatibility for production
  • node/alpine/: Alpine Linux-based (~70MB) – Optimized for size

Archived Containers

archived/parity/ – Ethereum Parity client containers:

  • branch/: Development builds from Git branches
  • release/: Stable production releases

🚀 Quick Start

Prerequisites

  • mise – Polyglot tool version manager
  • Docker – Container platform

Environment Setup

# Clone the repository
git clone https://github.com/marcusrbrown/containers.git
cd containers

# Install development tools with mise
mise install

# Install Python dependencies
poetry install

# Install Node.js dependencies
pnpm install

# Setup pre-commit hooks
pre-commit install

Build a Container

# Build Node.js Alpine variant
docker build -t my-node-app:alpine node/alpine/

# Build Node.js release variant
docker build -t my-node-app:release node/release/

🛠️ Automation Scripts

This repository includes three powerful Python scripts accessible via Poetry:

Generate Dockerfiles

Create customized Dockerfiles with multi-architecture support:

# Generate a basic Dockerfile
poetry run generate-dockerfile --base-image debian:bullseye-slim --packages "curl wget python3"

# Multi-architecture with environment variables
poetry run generate-dockerfile \
  --base-image alpine:3.18 \
  --packages "nodejs npm" \
  --env "NODE_ENV=production PORT=3000" \
  --architecture "linux/amd64,linux/arm64"

# Extend existing Dockerfile
poetry run generate-dockerfile --existing-dockerfile ./node/alpine/Dockerfile --packages "git"

Collect Container Metrics

Gather build performance and image analytics:

# Collect metrics for all containers
poetry run collect-docker-metrics

# Collect metrics for specific registry
poetry run collect-docker-metrics --registry github

# View collected metrics
cat collected_metrics.yaml

Generate Image Tags

Create semantic tags based on container metadata:

# Generate tags for all containers
poetry run generate-image-tags

# View generated tags
cat generated_tags.json

🔧 Development Environment

Local Development

# Activate development environment
mise shell

# Run linting and formatting
pre-commit run --all-files

# Run specific script during development
poetry run python scripts/generate_dockerfile.py --help

VS Code DevContainer

Open the repository in VS Code and use the “Reopen in Container” command for a complete Docker-in-Docker development environment with all tools pre-configured.

⚙️ CI/CD Workflows

This repository includes comprehensive GitHub Actions workflows:

📚 Project Structure

├── node/                     # Node.js container variants
│   ├── alpine/              # Alpine-based builds
│   └── release/             # Debian-based builds
├── archived/                # Legacy container definitions
│   └── parity/             # Ethereum Parity client
├── scripts/                 # Automation tools
│   ├── generate_dockerfile.py
│   ├── collect_docker_metrics.py
│   └── generate_image_tags.py
├── .devcontainer/          # VS Code development environment
├── .github/workflows/      # CI/CD automation
└── docs/                   # Documentation

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

Development Workflow

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Make your changes
  4. Run tests and linting (pre-commit run --all-files)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

📄 License

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

🔗 Links

Visit original content creator repository https://github.com/marcusrbrown/containers

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *