This guide provides information about local development and the build process for PiCompose.
PiCompose uses pi-gen-action, a wrapper for the official pi-gen tool, to create Raspberry Pi OS images with automatic Docker Compose deployment capabilities.
- Git
- Basic knowledge of Bash shell programming
- An IDE for editing shell scripts (e.g., VS Code)
The project follows the standard structure for custom pi-gen stages:
stage-picompose/- Custom stage for PiCompose00-boot-scripts/- Boot scripts and Docker Compose managerfiles/compose-manager.sh- The main script for the Docker Compose manager01-run.sh- Installation script for the manager and systemd service
00-packages/- Docker installation and repository setup00-packages-nr- List of packages to be installed01-run.sh- Script to set up the Docker repository
99-cleanup/- Cleanup scripts for the final image
.github/workflows/- GitHub Actions workflow files
-
Clone the repository:
git clone https://github.com/YOURUSERNAME/PiCompose.git cd PiCompose -
The main development work focuses on:
- Modifying the Compose manager script (
stage-picompose/00-boot-scripts/files/compose-manager.sh) - Adjusting the installation scripts in
stage-picompose/
- Modifying the Compose manager script (
-
To perform local tests of the pi-gen process, you can consult the pi-gen-action README and apply the methods described there.
The build process runs automatically via GitHub Actions:
- Checkout of the repository
- Execution of the build with pi-gen-action and the specified parameters
- The existing
stage-picomposeis directly referenced in thestage-list
- The existing
- Compression and upload of the finished image
The workflow supports:
- Detailed output for better troubleshooting (
verbose-output: true) - Increased disk space for large images (
increase-runner-disk-size: true) - Automatic releases for tags
You can test the compose-manager.sh script locally without creating a complete image:
./scripts/test-compose-manager.shThis script creates a temporary test environment and simulates the boot partition with Docker Compose projects.
The project uses GitHub Actions to automatically build images and publish them as GitHub Releases.
-
Create a new tag to trigger a release build:
git tag v1.0.0 git push origin v1.0.0
-
The GitHub Actions workflow will automatically start and build and publish the image.
Based on the pi-gen-action examples, the following features have been implemented:
- Custom Stage Structure: Using a custom stage structure in
stage-picompose/ - Detailed Build Output: Activation of the
verbose-outputoption for better troubleshooting - Disk Space Optimization: Activation of the
increase-runner-disk-sizeoption for larger images
- Build fails in workflow: Check the GitHub Action logs for details.
- Problems with boot scripts: Test the
compose-manager.shscript locally with the test script.