Bake MyBB into Docker image at build time instead of runtime#1
Draft
visualcookie wants to merge 3 commits intomainfrom
Draft
Bake MyBB into Docker image at build time instead of runtime#1visualcookie wants to merge 3 commits intomainfrom
visualcookie wants to merge 3 commits intomainfrom
Conversation
Previously, MyBB was downloaded at container runtime which posed risks of data loss if downloads failed during container recreation. Now: - MyBB is downloaded and installed during Docker image build - Each image contains a specific MyBB version (no runtime downloads) - GitHub Actions builds images for the 2 latest MyBB versions (1838, 1839) - Container startup copies pre-installed MyBB from image to volume - Version mismatch detection warns when image differs from installed version - Upgrade mode still works for migrating between versions https://claude.ai/code/session_017iViynCSN8iwn6NiUetwsp
- Remove download_mybb/extract_mybb functions from entrypoint - Upgrade mode now uses pre-installed MyBB from image instead of downloading - Simplify docker-compose files and documentation - Clean up verbose comments https://claude.ai/code/session_017iViynCSN8iwn6NiUetwsp
Follow the approach used by mybb/docker - on every container start, sync files from image to volume using rsync. Existing files are preserved automatically (--ignore-existing), so configs, uploads, plugins, and themes survive upgrades without special handling. Changes: - Rewrite entrypoint to ~100 lines (was ~450) - Remove UPGRADE_MODE, PRESERVE_PLUGINS, PRESERVE_THEMES - Add rsync to Dockerfile - Simplify documentation https://claude.ai/code/session_017iViynCSN8iwn6NiUetwsp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fundamentally changes how MyBB is delivered in the Docker image. Instead of downloading MyBB at container startup (runtime), MyBB is now pre-installed into the image at build time. This improves reliability, security, and deployment consistency.
Key Changes
Dockerfile: Added build-time MyBB installation that downloads and extracts MyBB during image build, storing it in
/opt/mybb-source. MadeMYBB_VERSIONa required build argument.GitHub Actions Workflow:
mybb_versioninput required for manual buildsLATEST_MYBB_VERSIONenvironment variable for consistencybuild-versionsmatrix to only build the 2 latest MyBB versions (1838, 1839) to reduce maintenance burdenEntrypoint Script:
.mybb_versionfiles in both image and volumeDocker Compose Files:
docker-compose.yml: Now usesMYBB_VERSIONas a build argument (local development)docker-compose.ghcr.yml: UsesMYBB_TAGto select pre-built image versions; removed runtimeMYBB_VERSIONenv varDocumentation:
env.examplewith clearer configuration guidanceImplementation Details
/opt/mybb-sourceduring build and copied to/var/www/htmlat container startup.mybb_versionfiles to detect mismatches between image and installed versionsBenefits
✅ Reliability: No runtime downloads means faster startup and no network failures during container initialization
✅ Security: MyBB source is verified at build time, not downloaded at runtime
✅ Consistency: Every container from the same image has identical MyBB files
✅ Simplicity: Clearer separation between build-time and runtime concerns
✅ Maintainability: Reduced scope by focusing on 2 latest versions for pre-built images
https://claude.ai/code/session_017iViynCSN8iwn6NiUetwsp