How liteacz/whalesome works
Project type and purpose
• Whalesome is an open-source, Docker-centric utility toolkit. Its purpose is to provide a modular collection of shell scripts (under src/) that simplify “dockerizing” common server components (Apache, Nginx, PHP, Composer, Xdebug, etc.) by packaging each as a self-contained module with install hooks and init.d scripts. It exposes a small CLI (cmd.sh, src/bin/*) and a Dockerfile that assembles a Docker image containing all of these utilities.
File structure
• Top-level:
• .github/workflows/main.yml – CI pipeline (build & push image).
• Dockerfile – single multi-stage build that installs each package and copies in scripts.
• cmd.sh – entrypoint wrapper for invoking internal CLI.
• src/bin – actual CLI entrypoints: docker-entrypoint, lit, loop.
• src/init.d – global init scripts run at container start (create user, fix ownership, etc.).
• src/packages/* – modular packages, each with:
• install.sh – installation steps during image build.
• init.d/*.sh – runtime configuration scripts.
• configuration templates (e.g., httpd.conf, nginx.conf, php-fpm.conf).
• error pages where relevant.
• No separate “frontend/backend”: this is a tooling image.
README
• Single‐line summary: “Docker image holding utility scripts for convenient dockerizing.”
• No additional architecture notes—architecture is implicit in file layout.
Main components & relationships
a. Components:
1. Developer / CI system (.github)
2. Docker build (Dockerfile + src/packages/*)
3. CLI tools (src/bin/docker-entrypoint, lit, loop)
4. Global init.d scripts (src/init.d/)
5. Modular packages (Apache-FPM, Nginx-FPM, PHP-FPM, Composer, Xdebug)
6. Runtime container with all installed utilities
b. Interactions:
• CI triggers Docker build → reads Dockerfile → invokes each package’s install.sh in sequence → yields final image.
• At container startup, Docker ENTRYPOINT calls docker-entrypoint (from src/bin) → sources src/init.d/* scripts → invokes each package’s init.d/*.sh to configure services based on environment variables.
• CLI commands (lit, loop) available inside container for further scripting.
c. Architectural patterns:
• Modular plugin pattern: each package is a self-contained plugin with its own installation and init steps.
• Init-style configuration pattern: uses SysV-style init.d ordering to configure at runtime.
d. Key technologies:
• Docker multi-stage builds
• Shell scripting (bash)
• Init.d ordering (100-, 101-, etc.)
• GitHub Actions for CI
Detail guidance
• Central role of src/bin/docker-entrypoint orchestrating runtime configuration.