Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
Modernizes the container build/release pipeline by moving to a multi-architecture Docker Buildx Bake approach on GitHub Actions (with GHA caching and a manifest-merge deploy step), while updating the application’s container base images to support newer CakePHP/PHP requirements.
Changes:
- Added a new multi-arch GitHub Actions workflow that builds/pushes per-arch images and then merges them into multi-platform manifests.
- Refactored
docker-bake.hclto introduce a shared GHA cache target, registry variables, and per-arch groups/targets with arch-suffixed tags. - Updated Dockerfiles to use newer Node/PHP base images; removed the legacy CircleCI and older GitHub Actions workflow.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/docker-build.yml |
New multi-arch Buildx Bake workflow + deploy manifest-merge job. |
docker-bake.hcl |
Adds registry/SHA vars, shared cache target, and per-arch build groups/targets. |
manifest-push.sh |
New script to merge per-arch tags into multi-platform manifests. |
common.env |
Updates BALENA_PROJECTS to service-name list used by manifest merge loop. |
Dockerfile.x86_64 |
Updates Node/PHP base images for amd64 build. |
Dockerfile.aarch64 |
Updates Node/PHP base images for arm64 build. |
Dockerfile.armhf |
Updates Node/PHP base images for arm/v7 build. |
Dockerfile.template |
Updates Node/PHP base images in the template. |
.github/workflows/build.yml |
Removed legacy workflow replaced by docker-build.yml. |
.circleci/config.yml |
Removed legacy CircleCI pipeline replaced by GitHub Actions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Write buildkit secrets | ||
| run: | | ||
| mkdir -p .balena/secrets | ||
| echo "${{ secrets.MYSQL_ROOT_PASSWORD }}" > .balena/secrets/secret_mysql_root_password | ||
| echo "${{ secrets.MYSQL_USER }}" > .balena/secrets/secret_mysql_user | ||
| echo "${{ secrets.MYSQL_PASSWORD }}" > .balena/secrets/secret_mysql_password | ||
| echo "${{ secrets.MYSQL_DATABASE }}" > .balena/secrets/secret_mysql_database | ||
| echo "${{ secrets.MASTER_PASSWORD }}" > .balena/secrets/secret_master_password | ||
|
|
| @@ -0,0 +1,85 @@ | |||
| #!/usr/bin/env bash | |||
| set -eu | |||
| # BEGIN - Multi-stage Build | ||
| # Stage 1: Install NodeJS dependencies | ||
| FROM node:20-alpine3.16 AS node-build | ||
| FROM node:20-alpine AS node-build |
| # BEGIN - Multi-stage Build | ||
| # Stage 1: Install NodeJS dependencies | ||
| FROM node:20-alpine3.16 AS node-build | ||
| FROM node:20-alpine AS node-build |
| # BEGIN - Multi-stage Build | ||
| # Stage 1: Install NodeJS dependencies | ||
| FROM node:20-alpine3.16 AS node-build | ||
| FROM node:20-alpine AS node-build |
| # BEGIN - Multi-stage Build | ||
| # Stage 1: Install NodeJS dependencies | ||
| FROM node:20-alpine3.16 AS node-build | ||
| FROM node:20-alpine AS node-build |
| permissions: | ||
| contents: read |
b23prodtm
left a comment
There was a problem hiding this comment.
docker-bake.hcl needs renaming secret files to id=some_var, target=./balena/secrets/some_var_file
This comment has been minimized.
This comment has been minimized.
|
@copilot use project example b23prodtm/abudgetmanager contents Dockerfile a docker/compose to fix code in the current project runtime so that it build up correctly up to the deployment, abudgetmanager a many similarities and is more recently treated with balena cloud services working cakephp setup. There are rules I've been working on as using the one click deploy button method. Just follow the file structure in the example project I mentioned above. |
Replaces the outdated single-arch CircleCI + GitHub Actions setup with the proven multi-platform buildkit strategy from
balena-photo-cropper. Adds fullarmhf/aarch64/x86_64matrix builds, GHA layer caching, buildkit secret mounts, and manifest merging.CI/CD
.github/workflows/docker-build.yml— replacesbuild.yml; usesdocker/bake-action@v5, full 3-arch matrix, separated "Write buildkit secrets" step, GHA cache injection, manifest merge in deploy job.circleci/config.ymland.github/workflows/build.ymlpermissions: contents: read / actions: writeon both jobs (least-privilege)docker-bake.hcl
REGISTRY,REGISTRY_IMAGE,GITHUB_SHAvariablescommontarget inheriting GHA cache (type=gha) — all service targets inherit itarmhf/aarch64/x86_64, each building all 4 services with platform-suffixed tags (arm32v7,arm64v8,amd64) plus branch-safe and SHA tagsmanifest-push.sh (new)
common.envforBALENA_PROJECTS, parsesREGISTRY/DOCKER_ORGfromdocker-bake.hcllatestonmain/developmentcommon.env
BALENA_PROJECTSupdated from path-based entries to service names:( php-fpm httpd mysqldb balena-storage )Dockerfiles
7.4.33-fpm-alpine3.16→8.3-fpm-alpineacross all arch variants and template (PHP 8.1+ required for CakePHP 5)node:20-alpine(drops end-of-life alpine 3.16)