Skip to content

Add script to build and push images without GitHub Actions - #9

Merged
kdambekalns merged 2 commits into
mainfrom
task/local-build-script
Nov 5, 2026
Merged

kdambekalns merged 2 commits into
mainfrom
task/local-build-script

Conversation

@kdambekalns

@kdambekalns kdambekalns commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

If GitHub Actions is not available, bin/build-and-push.sh builds and pushes the images from a workstation the way .github/workflows/docker.build.yaml does:

  • builds the latest release tag (v*) in a temporary git worktree, not the working copy
  • reads the matrix from the build workflow of that tag
  • takes the PHP version of each branch from the org.opencontainers.image.version label of harbor.flownative.io/docker/php:<branch>, like flownative/action-docker-get-label
  • builds both variants, composer and root (--user picks one); instead of appending USER … to the Dockerfile, each variant gets a Dockerfile copy of its own
  • linux/amd64,linux/arm64, the same tags for Docker Hub and Harbor, the same OCI labels; --pull so the newest base image is used
  • falls back to the locally known tags if git fetch fails
  • without options it only shows the plan; --build builds without pushing, --push builds and pushes after a confirmation (--yes skips it)
  • runs with the Bash 3.2 that ships with macOS; shellcheck is clean

Companion of flownative/docker-php#69 and flownative/docker-beach-php#45.

Measured on Apple Silicon with OrbStack, --build --no-cache: PHP 8.4.27, user composer 50 s, user root 37 s.

Not tested yet: an actual --push.

Refs OPS-8S (https://minka.flownative.com/go/card/OPS-8S)

kdambekalns and others added 2 commits November 4, 2026 19:31
bin/build-and-push.sh builds the images on a workstation the way the
build workflow does: from the latest release tag, for linux/amd64 and
linux/arm64, with the same tags and labels. The PHP branches and users are read
from the workflow of that tag, and the PHP version of each branch is
taken from the version label of the newest harbor.flownative.io/docker/php
image. Instead of appending the USER statement to the Dockerfile, every
variant gets a Dockerfile copy of its own.

Without options it only shows the plan; --build builds without pushing,
--push builds and pushes after a confirmation.

Refs OPS-8S

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On GitHub the matrix comes from the workflow on main, while the code is
the one of the latest release tag. The script read the matrix from the
workflow of the tag instead, so a version entered on main but not yet
tagged was built by the workflow but not by the script.

Refs OPS-8S

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kdambekalns kdambekalns self-assigned this Nov 5, 2026
@kdambekalns
kdambekalns marked this pull request as ready for review November 5, 2026 18:26

@kdambekalns kdambekalns left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kdambekalns
kdambekalns merged commit d18e1a9 into main Nov 5, 2026
@kdambekalns
kdambekalns deleted the task/local-build-script branch November 5, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant