Skip to content

Mirror release images to Docker Hub - #149

Open
diolektor wants to merge 1 commit into
mainfrom
ci/dockerhub-mirror
Open

Mirror release images to Docker Hub#149
diolektor wants to merge 1 commit into
mainfrom
ci/dockerhub-mirror

Conversation

@diolektor

@diolektor diolektor commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • release.yml and weekly-rebuild.yml now publish all arch-specific tags, multi-arch manifests, and aliases to docker.io/oxphp/oxphp in parallel with ghcr.io/oxphp/oxphp.
  • Every push / manifest-create / cosign-sign / move-aliases step is wrapped in a loop over the two registries; scripts/move-aliases.sh was not modified (it is already parametrized via REGISTRY).
  • Added Docker Hub login (DOCKERHUB_USERNAME / DOCKERHUB_TOKEN) to every job that pushes, creates a manifest, or signs.
  • manifest-84 / manifest-85 additionally export canonical_minor_dh / canonical_patch_dh so that the corresponding sign-* jobs also sign the DH manifests (keyless OIDC).

Pre-merge requirements

  • Create the oxphp/oxphp repository on Docker Hub.
  • Add the following GitHub repo secrets:
    • DOCKERHUB_USERNAME — DH login
    • DOCKERHUB_TOKEN — access token with Read/Write/Delete permissions

Edge case (to document)

In weekly-rebuild.yml, the Resolve last-published upstream digest step reads the annotation only from ${REGISTRY}/${IMAGE_NAME}:php${PHP_MINOR} (ghcr). On the first weekly run after DH is enabled, ghcr may return skip=true, in which case the DH tags will not be updated in that cycle. Self-healing happens on the next PHP patch, or on the next release tag (v*.*.* is guaranteed to do a full run to both sides).

Test plan

  • Add the DH secrets to the repo.
  • Verify the full pipeline on a test tag (v0.0.0-dh-test) — confirm that canonical + alias tags appear in both registries, and that cosign verify works on both.
  • Trigger weekly-rebuild via workflow_dispatch and confirm that parity is maintained.

CI:
  - release.yml and weekly-rebuild.yml now publish every arch-specific tag, multi-arch manifest, and alias to docker.io/oxphp/oxphp in addition to ghcr.io/oxphp/oxphp. Push, manifest-list creation, and alias-move steps iterate over both registry prefixes; canonical tags and all moved aliases are cosign-signed (keyless OIDC) in both registries.
  - Each job that touches a registry adds a Docker Hub login step using DOCKERHUB_USERNAME / DOCKERHUB_TOKEN secrets alongside the existing ghcr login.
  - manifest-84 / manifest-85 export additional canonical_minor_dh / canonical_patch_dh outputs so the corresponding sign jobs can sign the Docker Hub manifests.
  - move-aliases.sh is invoked twice per aliases job (once with REGISTRY=ghcr.io/oxphp/oxphp, once with REGISTRY=docker.io/oxphp/oxphp); the script itself is unchanged.

Config:
  - Added DOCKERHUB_REGISTRY and DOCKERHUB_IMAGE_NAME workflow env vars.
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