How nginx/docker-nginx works
Project type and purpose
• This is the “official-image” repository for nginx on Docker Hub. It provides:
• Dockerfile templates for multiple base images (alpine, debian, slim, otel, perl)
• entrypoint scripts for container runtime configuration
• multi-architecture build and test harness
• CI/CD workflows to build, test, and publish nginx images
File structure
• Top-level directories:
• mainline/ and stable/ – different release channels, each containing per-variant Dockerfiles and entrypoint snippets
• modules/ – build recipes for dynamic modules
• entrypoint/ – scripts that run inside the container at startup
• .github/workflows/ – CI definitions (GitHub Actions)
• .test/ – integration tests invoking containers with various configs
• Root scripts (sync-awsecr.sh, update.sh) – automation for syncing images and updating library
• Patterns:
• Template-driven Dockerfile generation (generate-stackbrew-library.sh)
• Multi-arch build via both GitHub Actions and external Jenkins (badges in README)
• Separation of “build” (Dockerfiles, modules) vs “test” vs “publish”
README for additional insights
• Confirms multi-arch build status and channels (amd64, arm, s390x, etc.)
• Points to external docs repo for user instructions and Docker Hub page for usage
Main components
a. Source code repository (GitHub)
b. CI/CD pipelines
• GitHub Actions (ci.yml, sync.yml, f5_cla.yml)
• External Jenkins multi-arch pipelines
• Shell scripts (sync-awsecr.sh, update.sh)
c. Build engines
• Docker build on various base images and architectures
• modules build sub-system
d. Testing layer
• .test harness invoking built images against sample configs
e. Docker Hub / Registrierung
• Official nginx images with tags (stable, mainline, variants, arches)
f. Runtime container
• entrypoint scripts configuring nginx (IPv6, resolvers, worker tuning)
Relationships and interactions
• Developer pushes commits → triggers GitHub Actions
• GitHub Actions calls generate-stackbrew-library.sh, builds Dockerfiles per channel
• Actions and Jenkins build images on different architectures
• CI jobs invoke .test scripts pulling built images, running nginx with sample configs
• On success, images are pushed to Docker Hub and AWS ECR (via sync-awsecr.sh)
• At runtime, container uses entrypoint scripts to configure nginx before starting
Architectural patterns and principles
• Template and convention-over-configuration: one repo supports many variants
• Multi-stage and multi-arch builds driven by script generation
• Clear separation of build, test, and publish phases
• Modular entrypoint for container startup logic
Elements
• Clear labels: “GitHub Repo,” “GitHub Actions,” “Jenkins Multi-arch,” “Docker Hub,” “AWS ECR,” “.test Harness,” “Container Runtime”
• Rectangles for code repositories and scripts
• Clouds for CI services
• Containers for runtime