This page looks best with JavaScript enabled

How to Add a Registry Mirror in Docker

 ·  ☕ 1 min read  ·  ✍️ Feynman

My Environment

CentOS Linux release 7.6 on QingCloud Platform

Configure the Docker daemon

Either pass the –registry-mirror option when starting dockerd manually, or edit /etc/docker/daemon.json and add the registry-mirrors key and value, to make the change persistent.

{
  "registry-mirrors": ["https://<my-docker-mirror-host>"]
}

Save the file and reload Docker for the change to take effect.

Reload Docker

Flush changes and restart Docker:

sudo systemctl daemon-reload
sudo systemctl restart docker

Reference

Share on

Feynman Zhou
WRITTEN BY
Feynman
Community Manager, CNCF Ambassador, InfoQ DevOps Editor