Using registry mirrors was broken with v3.1
tedivm opened this issue · comments
Contributing guidelines
- I've read the contributing guidelines and wholeheartedly agree
I've found a bug, and:
- The documentation does not mention anything about my problem
- There are no open or closed issues that are related to my problem
Description
Starting in v3.1, which released the PR for #151, you've hardcoded the image registry to docker.io on the image itself.
This breaks everyone who is using an registry mirror, because it forces people to use your registry specifically while ignoring the possibility someone might want to use a mirror. This is even more critical because you've introduced rate limits to your registry.
The solution to #151 is not to force every user onto your registry, but to provide documentation for the REGISTRY_HOST environment variable so people can switch to it when they want.
Expected behaviour
If I'm using a registry mirror I want to actually use that mirror.
Actual behaviour
Instead of using our mirror we're being forced to the docker.io, which means we're being rate limited. This in turn means the action is breaking our pipelines.
Repository URL
No response
Workflow run URL
No response
YAML workflow
name: Container Build and Publish
run-name: Build and Push Docker Image
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
release:
jobs:
Build-and-Push:
steps:
# This step should use the configured mirror in our runners, but doesn't.
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.0.0
Workflow logs
No response
BuildKit logs
Pulling binfmt Docker image
/usr/bin/docker pull docker.io/tonistiigi/binfmt:latest
Error response from daemon: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
Error: Error response from daemon: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit
Additional info
No response
Note that setting the version to v3.0.0
resolves the issue, but anyone who sets it to v3
gets the currently broken action.
The solution to #151 is not to force every user onto your registry,
It doesn't force anyone, docker.io
is the canonical reference for Docker's public registry where this image is effectively hosted. So, with the image reference docker.io/tonistiigi/binfmt:latest
or tonistiigi/binfmt:latest
, Docker will look for the image on Docker Hub or its configured mirror. If that's not the case then it might be a bug on moby.
Just to make sure, does it work with this?:
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
but to provide documentation for the REGISTRY_HOST environment variable so people can switch to it when they want.
Where do you see REGISTRY_HOST
documented? Can't find anything on my side.