Configure a mirror registry
Lower rate limits imposed on the Docker Hub End-User License Agreement (EULA) made it difficult for community members to access the docker.io
images frequently. A simple solution to this problem is to configure a mirror for the docker.io
registry in the registries.conf
file. This way, they can access the Docker resources whenever needed.
With the Podman Desktop UI, you can add registry locations and configure their mirrors easily. Configuring a mirror redirects a registry to another location, enabling you to use its content. For example, if you have configured ghcr.io
as a mirror for docker.io
and try to pull a resource, Podman pulls the resource from ghcr.io
instead of docker.io
.
The blog covers how to configure a mirror for the docker.io
registry.
Prerequisites
- Upgrade to the latest version of Podman.
- Recreate your Podman machine. Otherwise, you get a notification when you set up your registry configuration:
Configuring: A mirror for docker.io
- Go to the Settings > Resources page.
- Select More Options > Setup registry configuration in the Podman tile. A command palette opens.
- Set up your registry configuration:
- Select the Add registry configuration option from the command palette.
- Type the location of the registry, such as
docker.io
, and press theEnter
key. Thedocker.io
registry is added to the palette. - Select
docker.io
from the command palette. - Type the location where you want to mirror the registry, such as
ghcr.io
, and press theEnter
key. The entry for thedocker.io
registry shows the location where it is mirrored. - Select the
End configuring registries
option to end registry configuration.
Verifying: the mirror
There is no direct way to verify the mirror configuration from the UI. But, you can use the CLI for verification.
- Start an interactive session with the default Podman machine:
$ podman machine ssh <machine_name>
- Pull an invalid image from
docker.io
.
$ podman pull docker.io/invalid
An error message appears in the terminal indicating a failure to pull the image from the mirror. You receive the error message: Mirrors have also failed
.