How liferay/liferay-docker works
Project Type and Purpose
• This is a DevOps tooling repository for building, testing, and orchestrating Liferay Docker images and related services.
• It comprises:
• A “build system” (shell scripts, GitHub Actions) to produce Docker images from templates.
• A “template library” of Dockerfiles and resources for each service (Liferay, DB, search, monitoring, etc.).
• Orchestration frameworks (narwhal, orca) offering docker-compose setups, Puppet modules, and deployment scripts.
• Release tooling to generate BOMs, run tests, and publish images/BOMs.
File Structure & Patterns
• Top‐level “build_*” and “_common” shell scripts invoke Docker builds, test harnesses, and release workflows.
• “templates/” contains subdirs for each image type—each is a Docker build context.
• “narwhal/” and “orca/” are two orchestration layers:
• narwhal: sample docker-compose demos, Puppet modules, CI templates, release‐builder, tang-server, etc.
• orca: configs, scripts, and templates to install multi-container environments via Docker/Puppet.
• “release/” holds scripts to generate BOMs, releases.json, tests for release logic.
• CI config in “.github/workflows” automates builds and releases.
Main Components & Their Roles
a. Build & CI Layer
• Shell scripts (build_*.sh, run_tests.sh) orchestrate:
• Docker build → images from “templates/…” contexts
• Unit/integration tests for images
• Release logic (BOM generation, versioning)
• GitHub Actions workflows call these scripts on push/tag.
b. Docker Image Library
• Templates per service:
• liferay-bundle, dxp, portal
• db, search, monitoring, backup, vault, caddy, squid, zabbix, job-runner, node-runner, jar-runner, batch
• Each template folder: Dockerfile + “resources/” with entrypoint scripts, configs.
c. Orchestration & Environment Provisioning
• narwhal:
• demo applications (docker-compose demos)
• Puppet modules to bootstrap servers (liferay, CI, DB, etc.)
• “templates/ci” and “templates/release-builder” for CI container definitions
• orca:
• Config YAMLs for environment definitions (demo, single_server)
• Scripts to validate, build, and install orca-managed stacks
• Templates for each service container in an orca-deployed cluster
d. Release & Publishing
• release/: scripts to assemble and publish release artifacts
• Generates BOM POMs, JSON artifacts, and pushes images to Docker Hub
e. Testing & Validation
• test/*.sh harnesses for each image type
• run_tests.sh aggregates all tests
Relationships & Data Flows
• Developers → commit to GitHub → triggers CI (GitHub Actions) → invokes build scripts
• Build scripts → use Docker CLI + template contexts → produce images → push to Docker Hub
• Release scripts → read images and metadata → generate BOMs and publish releases
• Orchestration layers (narwhal/orca) consume published images + Puppet modules → deploy demo or production stacks
• Monitoring & backup containers interact at runtime with Liferay and DB containers
Architectural Patterns & Principles
• Modular Docker build contexts: one template per service.
• Single‐responsibility containers (web, db, search, monitoring, backup).
• Shell‐script “pipeline” calling Docker + tests + release tasks.
• Declarative environment definitions (docker-compose + Puppet + YAML configs).
• Reuse via common scripts (“_common.sh”) and shared Puppet modules.
Technologies & Frameworks
• Docker, Docker Compose
• Bash shell scripts
• GitHub Actions (release.yml)
• Puppet (modules under narwhal/puppet)
• YAML config files (orca/configs)
• Docker Hub for image registry
Essential Elements
• Clear, self-explanatory labels on every component
• Callouts for key scripts (build_all_images.sh, generate_release_notes.sh, orca.sh)