Aleksei Sviridkin 7ff0bf8904 ci(build): route PR base-image pulls through mirror.gcr.io (#3042)
## Problem

The Pull Request Build job authenticates only to the push registry
(OCIR), so every base image (golang, ubuntu, alpine, nginx, …) is pulled
from Docker Hub anonymously. Those pulls intermittently fail at
`auth.docker.io/token` under Docker Hub's anonymous-pull rate limit,
leaving the base image unresolved and failing `make build` — observed
across several maintainer-branch runs in a short window.

## Fix

Build the PR job on a docker-container buildx builder whose buildkitd
routes `docker.io` through `mirror.gcr.io` (Google's public pull-through
cache for Docker Hub: no auth, far higher limits, transparent
fall-through to Docker Hub on a miss). This reuses the builder pattern
already proven in `build-main.yaml` (same `make build`, same
`DOCKER_CONFIG` auth forwarding); only the committed
`hack/buildkitd.toml` mirror config is new. No base image versions or
tags change.

## Risk

Switches the PR build from the default embedded `docker` driver to a
docker-container builder. `build-main.yaml` already runs the identical
`make build` on that driver, so the path is exercised. The "Build Talos
image" step uses `docker run`/`skopeo` (not buildx) and is unaffected.

## Fallback

If `mirror.gcr.io` is unreachable, BuildKit logs `trying next host` and
falls back to `registry-1.docker.io`, so the build still succeeds.
Verified locally: a build pointed at a non-resolving mirror fell back to
Docker Hub and exited 0 (at a small latency cost from the failed
lookups). This strictly reduces build failures without adding a new hard
dependency.

## Coverage

Covered (the actual failure class — Docker Hub bases): `ubuntu`,
`golang*`, `alpine*`, `debian*`, `grafana/grafana`,
`nginxinc/nginx-unprivileged`, `clickhouse/*`, `altinity/*`, and
explicit `docker.io/library/*`. Not covered, and never the problem:
`quay.io/*`, `gcr.io/distroless/static`, `ghcr.io/siderolabs/imager` —
the mirror is keyed to `docker.io` only, by design, and these were never
subject to Docker Hub limits.

## Optional follow-up (not in this PR)

The `moby/buildkit` builder image is still pulled from Docker Hub by the
daemon to bootstrap the container builder (the mirror lives inside
buildkit, so it cannot mirror its own bootstrap). That is one small
pinned image versus dozens of base images, so this change is a strict
net reduction in anonymous Docker Hub traffic. Pinning the bootstrap
image through a mirror is deliberately left out: a no-fallback mirror on
the bootstrap path would add risk for little gain.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved build reliability in pull request checks by using a
configured container-based build setup.
* Added a safer image-pull path for Docker Hub, with automatic fallback
if the mirror is unavailable.
* Preserved registry access during image builds so dependency and
base-image fetching works more consistently.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-06-26 05:46:08 +03:00
2025-10-08 09:43:34 +05:00
2025-04-01 18:48:14 +02:00
2024-02-08 12:04:32 +01:00
2026-03-17 02:57:52 +05:00

Cozystack Cozystack

Open Source Apache-2.0 License Support Active GitHub Release GitHub Commit OpenSSF Best Practices

Cozystack

Cozystack is a free platform and framework for building clouds.

Cozystack is a CNCF Sandbox Level Project that was originally built and sponsored by Ænix.

With Cozystack, you can transform a bunch of servers into an intelligent system with a simple REST API for spawning Kubernetes clusters, Database-as-a-Service, virtual machines, load balancers, HTTP caching services, and other services with ease.

Use Cozystack to build your own cloud or provide a cost-effective development environment.

Cozystack user interface

Use-Cases

Documentation

The documentation is located on the cozystack.io website.

Read the Getting Started section for a quick start.

If you encounter any difficulties, start with the troubleshooting guide and work your way through the process that we've outlined.

Versioning

Versioning adheres to the Semantic Versioning principles.
A full list of the available releases is available in the GitHub repository's Release section.

Contributions

Contributions are highly appreciated and very welcomed!

In case of bugs, please check if the issue has already been opened by checking the GitHub Issues section. If it isn't, you can open a new one. A detailed report will help us replicate it, assess it, and work on a fix.

You can express your intention to on the fix on your own. Commits are used to generate the changelog, and their author will be referenced in it.

If you have a concrete feature request, open an issue. For a cross-cutting or architectural change, open a design proposal in the community repo. For questions or early ideas, use GitHub Discussions. See CONTRIBUTING.md for the full routing.

Community

You are welcome to join our Telegram group and come to our weekly community meetings. Add them to your Google Calendar or iCal for convenience.

License

Cozystack is licensed under Apache 2.0.
The code is provided as-is with no warranties.

Commercial Support

A list of companies providing commercial support for this project can be found on official site.

Languages
Go 48%
Shell 37%
TypeScript 6.9%
Go Template 5.3%
Makefile 1.4%
Other 1.2%