Skip to content

ci: pin and cache the MySQL image to survive Docker Hub outages#19

Closed
erikfrerejean wants to merge 1 commit into
6from
ci/cache-mysql-image
Closed

ci: pin and cache the MySQL image to survive Docker Hub outages#19
erikfrerejean wants to merge 1 commit into
6from
ci/cache-mysql-image

Conversation

@erikfrerejean

Copy link
Copy Markdown
Member

Why

The PHPUnit (PHP 8.5) job intermittently fails at Start services when Docker Hub times out pulling the mysql image:

db Error Head "https://registry-1.docker.io/v2/library/mysql/manifests/8": ... net/http: request canceled (Client.Timeout exceeded while awaiting headers)

PHPUnit then never runs, so coverage/phpunit-junit.xml is never produced — the cp and dorny/test-reporter steps fail downstream. It's a transient registry outage, not a code problem (8.3/8.4 passed the identical steps).

What

  • Pin db image mysql:8mysql:8.4 (LTS) — deterministic and trackable by the existing dependabot docker ecosystem watching /.docker.
  • New composite action .github/actions/cache-mysql-image — derives the image from compose.yml (single source of truth, no drift), restores it from the Actions cache, and only pulls from Docker Hub on a miss (then saves the tarball for next time).
  • Wired into both jobs. static-analysis is included because up app also starts db as a dependency, so it was exposed to the same outage.

Behaviour

First run pulls + saves mysql:8.4; every run after does docker load from cache and never touches Docker Hub for the db image. Cache key is db-image-mysql-8.4, so bumping the pin rotates the cache automatically.

Notes

  • The app image build still pulls its own base from Docker Hub — this only hardens the db pull, which is where the failures occurred. Buildx layer caching would be a separate, larger change.
  • Verified locally that docker compose -f .docker/compose.yml config --images db returns mysql:8.4; both YAML files parse clean.

The PHP 8.5 PHPUnit job intermittently failed at 'Start services' when
Docker Hub timed out pulling the mysql image, cascading into empty test
reports. Pin db to mysql:8.4 (LTS, dependabot-trackable) and add a
composite action that restores the image from the Actions cache, only
pulling from Docker Hub on a miss. Wired into both jobs since the
static-analysis job also starts db as a dependency.
@erikfrerejean erikfrerejean deleted the ci/cache-mysql-image branch June 22, 2026 14:02
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