Skip to content

Publish multi-arch Docker image via buildx#70

Open
rick-lam wants to merge 1 commit into
masterfrom
chore/docker-buildx-multiarch
Open

Publish multi-arch Docker image via buildx#70
rick-lam wants to merge 1 commit into
masterfrom
chore/docker-buildx-multiarch

Conversation

@rick-lam
Copy link
Copy Markdown
Collaborator

Summary

  • Adds .github/workflows/docker.yml to build linux/amd64 + linux/arm64 and push graze/morphism to Docker Hub on v* tag pushes (fixes no matching manifest for linux/arm64/v8 on Apple Silicon).
  • Switches Makefile to docker buildx: build-docker (host-arch, --load) and build-docker-multiarch (PLATFORMS, PUSH=1 opt-in).
  • Removes the legacy Docker Hub Automated Builds hooks/build.

Mirrors the pattern landed in graze/sprout#21. Docker tags are emitted via type=semver so the v6.0.5 git tag becomes 6.0.5 / 6.0 / latest on Docker Hub.

Notes

  • Requires DOCKERHUB_USERNAME / DOCKERHUB_TOKEN repo secrets.
  • Dockerfile runtime base is graze/php-alpine:7.4 — confirm an arm64 manifest exists before cutting a tag, otherwise the cross build will fail.

Test plan

  • Verify make build-docker builds locally on host arch.
  • Verify make build-docker-multiarch (without PUSH=1) cross-builds locally.
  • Confirm graze/php-alpine:7.4 ships an arm64 manifest (docker buildx imagetools inspect graze/php-alpine:7.4).
  • Cut a test tag (or use workflow_dispatch trial) and verify both arch manifests land on Docker Hub.

🤖 Generated with Claude Code

Adds a GH Actions workflow that builds linux/amd64 + linux/arm64
manifests on tag push and pushes to graze/morphism on Docker Hub,
fixing "no matching manifest for linux/arm64/v8" pulls on
Apple Silicon. Switches the Makefile to buildx (host-arch by
default, with a build-docker-multiarch target for local cross
builds) and removes the legacy Docker Hub Automated Builds
hooks/build script.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 26, 2026 16:56
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds automated multi-architecture (linux/amd64 + linux/arm64) Docker image publishing for graze/morphism on semver tag pushes, replacing the legacy Docker Hub Automated Builds hook, and provides matching buildx-based local Makefile targets so contributors can reproduce host-arch and multi-arch builds locally.

Changes:

  • New .github/workflows/docker.yml that uses docker/{setup-qemu,setup-buildx,login,metadata,build-push}-action to build and push multi-arch images, tagged via type=semver plus latest.
  • New build-docker and build-docker-multiarch Makefile targets (with PLATFORMS and opt-in PUSH=1) that mirror the workflow's build args.
  • Deletes the obsolete hooks/build Docker Hub Automated Builds script.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/docker.yml New tag-triggered workflow that builds and pushes the multi-arch image to Docker Hub.
Makefile Adds buildx-based host-arch and multi-arch build targets and registers them as .PHONY.
hooks/build Removes the legacy Docker Hub Automated Builds hook now superseded by the workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUILD_DATE=${{ github.event.repository.updated_at }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest
on:
push:
tags:
- 'v[0-9]+.[0-9]+'
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.

2 participants