Container Registry는 지원 중단되었으며 종료될 예정입니다. 2024년 5월 15일부터 Artifact Registry는 이전 Container Registry를 사용하지 않고 프로젝트의 gcr.io 도메인 이미지를 호스팅합니다. 2025년 3월 18일 이후에는 Container Registry가 종료됩니다.
Container Registry는 mirror.gcr.io에서 자주 액세스되는 공개 Docker Hub 이미지를 캐시합니다. 캐시된 공개 이미지를 사용할 수 있는 경우 Docker 데몬을 구성하여 이 이미지를 사용하거나 캐시된 사본을 사용할 수 없는 경우 Docker Hub에서 이미지를 가져올 수 있습니다.
Cloud Build 및 Google Kubernetes Engine과 같은 Google Cloud 서비스는 Docker Hub에서 이미지를 가져오기 전에 캐시된 이미지를 자동으로 확인합니다.
mirror.gcr.io에서 캐시된 이미지는 다음과 같습니다.
Google에서 관리하는 저장소에 저장됩니다.
Docker Hub 작동 중단으로부터 더욱 안전하게 보호됩니다.
Google Cloud 생태계와 쉽게 통합됩니다.
Docker Hub와 계속 동기화됩니다.
Docker 데몬 구성
Container Registry 캐시에서 이미지를 가져오도록 Docker 데몬을 구성하려면 다음 안내를 따르세요.
CLI
다음 방법 중 하나로 데몬을 구성합니다.
시작할 때 자동으로 Docker 데몬을 구성하려면 /etc/docker/daemon.json에 다음 값을 설정합니다.
Container Registry는 자주 요청되는 이미지를 나중에 요청에 사용할 수 있도록 캐시에 추가합니다. 더 이상 요청되지 않는 이미지도 주기적으로 삭제됩니다.
Container Registry 캐시를 사용하도록 Docker 데몬을 구성하면 Docker는 docker pull 명령어로 공개 Docker Hub 이미지를 가져올 때 다음 단계를 수행합니다.
Docker 데몬은 Container Registry 캐시를 확인하고 이미지가 있으면 가져옵니다. 데몬 구성에 다른 Docker 미러가 포함되어 있으면 데몬은 캐시된 이미지 복사본의 순서대로 각 미러를 확인합니다.
이미지를 발견하지 못하면 Docker 데몬은 Docker Hub의 정규 저장소에서 이미지를 가져옵니다.
캐시된 이미지를 가져오는 것은 Docker Hub 비율 제한에 포함되지 않습니다. 하지만 특정 이미지가 장시간 동안 캐시된 상태로 유지된다는 보장은 없습니다. Docker 데몬을 구성하여 mirror.gcr.io에서만 캐시된 이미지를 가져옵니다. 이미지의 캐시된 사본이 없으면 mirror.gcr.io에서 직접 가져오는 요청이 실패합니다.
다음 단계
자체 Docker 미러를 만들어 이미지를 캐시할 수 있습니다. 자세한 내용은 Docker 문서를 참조하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-12-21(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/)."]]