Skip to content

Instantly share code, notes, and snippets.

@janeczku
Last active December 13, 2021 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janeczku/0a2d1f5ac24c1f2cb669b639bf2d7fbe to your computer and use it in GitHub Desktop.
Save janeczku/0a2d1f5ac24c1f2cb669b639bf2d7fbe to your computer and use it in GitHub Desktop.
How to overwrite the Docker Hub default registry in the ContainerD Runtime

To configure a new default registry that will be used to pull images that do not have fully qualified image paths, modify the containerd configuration (/etc/containerd/config.toml) as follows:


version = 2
[plugins]
  [plugins."io.containerd.grpc.v1.cri"]
    [plugins."io.containerd.grpc.v1.cri".registry.mirrors]
      [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
        endpoint = ["https://private.registry.com:443"]
      [plugins."io.containerd.grpc.v1.cri".registry.mirrors."*"]
        endpoint = ["https://private.registry.com:443"]

Please note, that due to an unexpected behaviour of containerd it is currently necessary to explicitely define a mirror for the docker.io registry in addition to defining the default registry (using the wildcard).

Additional note:
nerdctl does not use the CRI API and as such disregards any registry configuration defined in /etc/containerd/config.toml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment