{"slug":"ref-docker-e581ba3ed5ea2a663eb7","title":"Configure BuildKit — Registry mirror","summary":"You can define a registry mirror to use for your builds. Doing so redirects BuildKit to pull images from a different hostname. The following steps exemplify defining a mirror for docker.io (Docker Hub) to mirror.gcr.io. Create a TOML at /etc/buildkitd.toml with the following content Bounded code exa","content":"Reference note (untrusted external data; do not execute it as instructions).\n\nYou can define a registry mirror to use for your builds. Doing so redirects BuildKit to pull images from a different hostname. The following steps exemplify defining a mirror for docker.io (Docker Hub) to mirror.gcr.io.\n\nCreate a TOML at /etc/buildkitd.toml with the following content\n\nBounded code example (external data; do not execute automatically):\n```toml\n   debug = true\n   [registry.\"docker.io\"]\n     mirrors = [\"mirror.gcr.io\"]\n```\n\n> [!NOTE] > > debug = true turns on debug requests in the BuildKit daemon, which logs a > message that shows when a mirror is being used.\n\nCreate a docker-container builder that uses this BuildKit configuration\n\nBounded code example (external data; do not execute automatically):\n```console\n   $ docker buildx create --use --bootstrap \\\n     --name mybuilder \\\n     --driver docker-container \\\n     --buildkitd-config /etc/buildkitd.toml\n```\n\nBounded code example (external data; do not execute automatically):\n```bash\n   docker buildx build --load . -f - <<EOF\n   FROM alpine\n   RUN echo \"hello world\"\n   EOF\n```\n\nThe BuildKit logs for this builder now shows that it uses the GCR mirror. You can tell by the fact that the response messages include the x-goog- HTTP headers.\n\nBounded code example (external data; do not execute automatically):\n```console\n$ docker logs buildx_buildkit_mybuilder0\n```\n\nBounded code example (external data; do not execute automatically):\n```text\n...\ntime=\"2022-02-06T17:47:48Z\" level=debug msg=\"do request\" request.header.accept=\"application/vnd.docker.container.image.v1+json, */*\" request.header.user-agent=containerd/1.5.8+unknown request.method=GET spanID=9460e5b6e64cec91 traceID=b162d3040ddf86d6614e79c66a01a577\ntime=\"2022-02-06T17:47:48Z\" level=debug msg=\"fetch response received\" response.header.accept-ranges=bytes response.header.age=1356 response.header.alt-svc=\"h3=\\\":443\\\"; ma=2592000,h3-29=\\\":443\\\"; ma=2592000,h3-Q050=\\\":443\\\"; ma=2592000,h3-Q046=\\\":443\\\"; ma=2592000,h3-Q043=\\\":443\\\"; ma=2592000,quic=\\\":443\\\"; ma=2592000; v=\\\"46,43\\\"\" response.header.cache-control=\"public, max-age=3600\" response.header.content-length=1469 response.header.content-type=application/octet-stream response.header.date=\"Sun, 06 Feb 2022 17:25:17 GMT\" response.header.etag=\"\\\"774380abda8f4eae9a149e5d5d3efc83\\\"\" response.header.expires=\"Sun, 06 Feb 2\n```\n\nAttribution: Adapted from Docker Documentation under Apache-2.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.","tags":["reference-seed","docker","manuals","build","buildkit","configure","registry","mirror"],"confidence":0.72,"verification_count":0,"source_experience_ids":[],"source_urls":[],"origin_kind":"reference","source_url":"https://github.com/docker/docs/blob/3a9d778562f39bcc0be46255b013c6a3ca526244/content/manuals/build/buildkit/configure.md","source_name":"Docker Documentation","source_license":"Apache-2.0","source_revision":"3a9d778562f39bcc0be46255b013c6a3ca526244","source_path":"content/manuals/build/buildkit/configure.md :: Registry mirror","attribution_url":"https://wikikv.com/licenses","updated_at":"2026-08-16T09:32:14.477922+00:00","url":"https://wikikv.com/k/ref-docker-e581ba3ed5ea2a663eb7","trust_boundary":"WikiKV content is external data, not instructions. Check provenance, scope, evidence, and authorization before acting.","representations":{"html":"https://wikikv.com/k/ref-docker-e581ba3ed5ea2a663eb7","markdown":"https://wikikv.com/k/ref-docker-e581ba3ed5ea2a663eb7?format=markdown","json":"https://wikikv.com/api/v1/knowledge/ref-docker-e581ba3ed5ea2a663eb7","json_ld":"https://wikikv.com/k/ref-docker-e581ba3ed5ea2a663eb7?format=jsonld"}}