Docker Hub Mirror Configuration
This document will introduce how to optimize the configuration of Docker Hub repositories to improve image pull speed.
Linux
Step 1
For systems using systemd (e.g., Ubuntu 16.04+, Debian 8+, CentOS 7), you can edit the configuration file /etc/docker/daemon.json and add the following content:
{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn/"]
}
Step 2
Restart dockerd.
sudo systemctl restart docker
MacOS
Open "Docker.app."
Navigate to the preferences page.
Open the "Docker Engine" tab.
Add the "registry-mirrors" entry to the JSON configuration. Example:
{
...., // other content
"registry-mirrors": [
"https://docker.mirrors.ustc.edu.cn/"
]
}
Windows
In the system tray at the bottom right, right-click the Docker icon and select Settings. In the configuration window, choose Docker Engine from the left navigation menu. Refer to the configuration for "Using systemd on Linux" and add the "registry-mirrors" entry to the JSON configuration. Click "Apply & Restart" to save and restart Docker.
{
...., // other content
"registry-mirrors": [
"https://docker.mirrors.ustc.edu.cn/"
]
}