Skip to content

ci: pull the Debian base images from ECR Public, pinned by digest - #85

Merged
heyJordanParker merged 3 commits into
masterfrom
ci/base-image-mirror
Oct 10, 2026
Merged

heyJordanParker merged 3 commits into
masterfrom
ci/base-image-mirror

Conversation

@heyJordanParker

Copy link
Copy Markdown
Owner

php-sharp's LINUX job and the release image pulled debian:trixie and debian:trixie-slim anonymously from Docker Hub. On 2026-10-09 Docker Hub answered 429 and then 504, and that failed LINUX on #82 and on another branch in the same window. The release image (IMAGE, on v* tags) pulls the same way.

Change (2 files, +3/−3)

--- sharp/docker/Dockerfile
-FROM debian:trixie
+FROM public.ecr.aws/docker/library/debian:trixie@sha256:913f6706df59a68922d1dd08f78c2476560a8d367897200a6005b00e5f67c2d5
--- sharp/docker/runtime/Dockerfile (both stages)
-FROM debian:trixie-slim
+FROM public.ecr.aws/docker/library/debian:trixie-slim@sha256:a29215f6a35e51e22adffa17f89e9d2ef06214e64a2bad10d765c46aea49f11f

ECR Public mirrors Docker Hub's official images and has no anonymous pull limit. On 2026-10-10, docker buildx imagetools inspect showed the same multi-arch index digests on both registries, and the amd64 and arm64 manifests inside them match too.

Every other image reference

  • Not on Docker Hub: mcr.microsoft.com (setup-mssql) and the local php-sharp-linux tag that sharp/docker/run builds.
  • Upstream php-src CI that never runs in this fork: test-suite.yml (its caller Test is disabled), .circleci, and benchmark/docker-compose.yml.
  • Manual examples: for instance ext/opcache/jit/Dockerfile.arm64.example.
  • No cache key uses a base image tag.

Remaining Docker Hub pull, not changeable here

The IMAGE job's reusable docker/github-builder sets BUILDKIT_IMAGE: moby/buildkit:v0.32.2 in its own workflow env. It exposes no input to override that, and it pulls BuildKit before any login step. moby/buildkit isn't an official image, so ECR Public doesn't mirror it. That leaves one anonymous pull per runner, on v* tags only. Removing it would mean replacing docker/github-builder with our own buildx jobs.

Proof

  • Local dev image (sharp/docker/run's own build): it pulled public.ecr.aws/docker/library/debian:trixie@sha256:913f… and runs Debian 13.7.
  • Local release image (docker-container builder, as IMAGE uses): it pulled public.ecr.aws/docker/library/debian:trixie-slim@sha256:a292… and built. php --ri sharp prints Version => 0.3.0 and Mago commit => 58c7c4a18….
  • LINUX on this PR proves the CI path.

Problem:
Both php-sharp images start FROM a Debian image on Docker Hub, pulled
anonymously. Docker Hub rate-limits anonymous pulls. On 2026-10-09 the
pull of debian:trixie failed with 429 and then 504, and that failed the
LINUX job on PR #82 and on another branch in the same window. The IMAGE
job, which publishes ghcr.io/heyjordanparker/php-sharp on a v* tag,
pulls debian:trixie-slim the same way, so a release can fail the same
way.

Solution:
- Each FROM names the same Docker official image through ECR Public's
  mirror, public.ecr.aws/docker/library, which has no anonymous rate
  limit.
- Each reference is pinned to the multi-arch index digest, so amd64 and
  arm64 resolve to the same image on both registries. On 2026-10-10
  ECR Public and Docker Hub served the same index digests:
  debian:trixie       sha256:913f6706df59a68922d1dd08f78c2476560a8d367897200a6005b00e5f67c2d5
  debian:trixie-slim  sha256:a29215f6a35e51e22adffa17f89e9d2ef06214e64a2bad10d765c46aea49f11f

sharp/docker/
├── Dockerfile           <- FROM public.ecr.aws/docker/library/debian:trixie@sha256:913f…c2d5
└── runtime/Dockerfile   <- both stages FROM public.ecr.aws/docker/library/debian:trixie-slim@sha256:a292…f11f
…y updates

Problem:
The three FROM lines pinned ECR Public's Debian images by digest.
php-sharp has no Dependabot or Renovate, so nothing would ever move
those pins. The release image would keep the base's libc and openssl
from the day of the pin, because apt-get install adds packages and
does not upgrade the ones the base already has.

Solution:
- Each FROM names the ECR Public tag without a digest:
  debian:trixie for the dev image, debian:trixie-slim for both stages
  of the release image. Every build takes the tag's current image,
  which Debian rebuilds with its security updates.
- The images still come from public.ecr.aws/docker/library, so
  Docker Hub's anonymous pull limit still does not apply.

sharp/docker/
├── Dockerfile           <- FROM public.ecr.aws/docker/library/debian:trixie
└── runtime/Dockerfile   <- both stages FROM public.ecr.aws/docker/library/debian:trixie-slim
@heyJordanParker
heyJordanParker merged commit 57be16b into master Oct 10, 2026
6 checks passed
@heyJordanParker
heyJordanParker deleted the ci/base-image-mirror branch November 3, 2026 22:08
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