--- title: Configure BuildKit description: Learn how to configure BuildKit for your builder. keywords: build, buildkit, configuration, buildx, network, cni, registry --- If you create a `docker-container` or `kubernetes` builder with Buildx, you can apply a custom [BuildKit configuration](toml-configuration.md) by passing the [`--config` flag](/reference/cli/docker/buildx/create.md#config) to the `docker buildx create` command. ## Registry mirror 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`. 1. Create a TOML at `/etc/buildkitd.toml` with the following content: ```toml debug = true [registry."docker.io"] mirrors = ["mirror.gcr.io"] ``` > [!NOTE] > > `debug = true` turns on debug requests in the BuildKit daemon, which logs a > message that shows when a mirror is being used. 2. Create a `docker-container` builder that uses this BuildKit configuration: ```console $ docker buildx create --use --bootstrap \ --name mybuilder \ --driver docker-container \ --config /etc/buildkitd.toml ``` 3. Build an image: ```bash docker buildx build --load . -f - <