Container Registry está obsoleto. A partir del 18 de marzo de 2025, Container Registry se cerrará y no se podrán escribir imágenes en él. Para obtener más información sobre la baja de Container Registry y cómo migrar a Artifact Registry, consulta Baja de Container Registry.
Extrae imágenes almacenadas en caché de Docker Hub
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Container Registry almacena en caché las imágenes públicas de Docker Hub a las que se accede con frecuencia en mirror.gcr.io. Puedes configurar el daemon de Docker para usar una imagen pública en caché, si existe una, o extraer la imagen de Docker Hub si no hay una copia almacenada en caché.
Los servicios deGoogle Cloud , como Cloud Build y Google Kubernetes Engine, comprueban de forma automática si hay imágenes en caché antes de intentar extraer una imagen de Docker Hub.
Las imágenes almacenadas en caché en mirror.gcr.io son las siguientes:
Se almacena en un repositorio que administra Google.
Están más aisladas de las interrupciones de Docker Hub.
Se integran fácilmente en el ecosistema de Google Cloud .
Se mantienen sincronizadas con Docker Hub.
Configura el daemon de Docker
Si deseas configurar tu daemon de Docker para extraer imágenes de la caché de Container Registry, sigue estos pasos:
CLI
Configura el daemon de una de las siguientes maneras:
Para configurar el daemon de Docker automáticamente al inicio, establece el siguiente valor como /etc/docker/daemon.json
{"registry-mirrors":["https://mirror.gcr.io"]}
Cuando inicies el daemon, ingresa el nombre de host de Container Registry:
dockerd--registry-mirror=https://mirror.gcr.io
Agrega la siguiente línea a tu archivo /etc/default/docker:
Container Registry agrega las imágenes solicitadas con más frecuencia a la caché a fin de que estén disponibles para solicitudes futuras. También quita las imágenes que ya no se solicitan de forma periódica.
Después de configurar el daemon de Docker para usar la caché de Container Registry, Docker realiza los siguientes pasos cuando extraes una imagen pública de Docker Hub con un comando docker pull:
El daemon de Docker comprueba la caché de Container Registry y recupera las imágenes si las hay. Si tu configuración de daemon incluye otras duplicaciones de Docker, el daemon verifica cada una para obtener una copia almacenada en caché de la imagen.
Si la imagen aún no se encuentra, el daemon de Docker recupera la imagen desde el repositorio canónico de Docker Hub.
La extracción de imágenes almacenadas en caché no cuenta para los límites de frecuencia de Docker Hub. Sin embargo, no hay garantía de que una imagen en particular se almacene en caché por un período prolongado. Obtén solo imágenes almacenadas en caché en mirror.gcr.io mediante la configuración del daemon de Docker. Una solicitud para extraer directamente desde mirror.gcr.io fallará si no existe una copia en caché de la imagen.
¿Qué sigue?
Puedes crear tus propias duplicaciones de Docker locales para almacenar en caché las imágenes. Para obtener más detalles, consulta la documentación de Docker.
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-08-11 (UTC)"],[[["\u003cp\u003eContainer Registry caches frequently-accessed public Docker Hub images on \u003ccode\u003emirror.gcr.io\u003c/code\u003e, improving image pull performance and reliability.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Cloud services automatically check for cached images before pulling from Docker Hub, streamlining workflows within the Google Cloud ecosystem.\u003c/p\u003e\n"],["\u003cp\u003eConfiguring the Docker daemon to use \u003ccode\u003emirror.gcr.io\u003c/code\u003e allows it to prioritize pulling images from the cache, falling back to Docker Hub if the image is not found there.\u003c/p\u003e\n"],["\u003cp\u003ePulling images from the Container Registry cache does not count against Docker Hub rate limits, offering a workaround to potential restrictions on the Docker Free plan.\u003c/p\u003e\n"],["\u003cp\u003eCached images are stored in a Google-managed repository, are kept in sync with Docker Hub, and offer greater insulation from Docker Hub outages.\u003c/p\u003e\n"]]],[],null,["# Pulling cached Docker Hub images\n\nContainer Registry caches frequently-accessed public Docker Hub images on\n`mirror.gcr.io`. You can configure the Docker daemon to use a cached public\nimage if one is available, or pull the image from Docker Hub if a cached copy\nis unavailable.\n\nGoogle Cloud services such as Cloud Build and Google Kubernetes Engine automatically\ncheck for cached images before attempting to pull an image from Docker Hub.\n| **Note:** As of November 1, 2020, Docker Hub\n| [rate limits](https://www.docker.com/blog/scaling-docker-to-serve-millions-more-developers-network-egress/) apply to unauthenticated or authenticated pull requests on the\n| Docker Free plan. To avoid disruptions and have greater control over your\n| software supply chain, you can migrate your dependencies to [Artifact Registry](/artifact-registry/docs/docker/migrate-external-containers).\n\nCached images at `mirror.gcr.io` are:\n\n- Stored in a repository that Google manages.\n- More insulated from Docker Hub outages.\n- Easily integrated with the Google Cloud ecosystem.\n- Kept in sync with Docker Hub.\n\nConfiguring the Docker daemon\n-----------------------------\n\nTo configure your Docker daemon to pull images from the Container Registry\ncache: \n\n### CLI\n\n1. Configure the daemon in one of the following ways:\n\n - To configure the Docker daemon automatically on startup, set\n the following value in `/etc/docker/daemon.json`\n\n {\n \"registry-mirrors\": [\"https://mirror.gcr.io\"]\n }\n\n - When you start the daemon, pass in the Container Registry\n hostname:\n\n dockerd --registry-mirror=https://mirror.gcr.io\n\n - Add the following line to your `/etc/default/docker` file:\n\n DOCKER_OPTS=\"${DOCKER_OPTS} --registry-mirror=https://mirror.gcr.io\"\n\n2. Restart the Docker daemon.\n\n - On Linux, run one of the following commands:\n\n sudo service docker restart\n\n or \n\n sudo service docker stop && sudo service docker start\n\n - On macOS or Windows, run the following command:\n\n docker-machine restart\n\n### Docker UI\n\n1. Open Docker's **Preferences** menu.\n2. Click **Daemon**.\n3. Click **Advanced** . In the JSON field, add a `registry-mirrors` key with\n `https://mirror.gcr.io` as a value:\n\n {\n \"registry-mirrors\" : [\n \"https://mirror.gcr.io\"\n ]\n }\n\n4. Click **Apply \\& Restart**.\n\nTo verify that the cache is correctly configured, run: \n\n docker system info\n\nThe output should include `Registry Mirrors`, and should look similar to\nthe following: \n\n Containers: 2\n Running: 0\n Paused: 0\n Stopped: 2\n Images: 2\n Server Version: 17.03.1-ce\n Storage Driver: overlay2\n Backing Filesystem: extfs\n Supports d_type: true\n Native Overlay Diff: true\n Logging Driver: json-file\n ...\n Registry Mirrors:\n https://mirror.gcr.io\n\nPulling cached images\n---------------------\n\nContainer Registry adds frequently requested images to the cache\nso they are available for future requests. It also periodically removes images\nthat are no longer requested.\n\nAfter you configure the Docker daemon to use the Container Registry cache,\nDocker performs the following steps when you pull a public Docker Hub image\nwith a `docker pull` command:\n\n1. The Docker daemon checks the Container Registry cache and fetches the images if it exists. If your daemon configuration includes other Docker mirrors, the daemon checks each one in order for a cached copy of the image.\n2. If the image still isn't found, the Docker daemon fetches the image from the canonical repository on Docker Hub.\n\nPulling cached images does not count against Docker Hub rate limits. However,\nthere is no guarantee that a particular image will remain cached for an extended\nperiod of time. Only obtain cached images on `mirror.gcr.io` by\n[configuring the Docker daemon](#configure). A request to pull directly from\n`mirror.gcr.io` will fail if a cached copy of the image does not exist.\n\nWhat's next\n-----------\n\n- You can create your own local Docker mirrors to cache images. For details, see the [Docker documentation](https://docs.docker.com/registry/recipes/mirror/).\n- Read the [Docker Hub documentation](https://docs.docker.com/docker-hub/)."]]