Skip to Main Content

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

  1. Open "Docker.app."

  2. Navigate to the preferences page.

  3. Open the "Docker Engine" tab.

  4. 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/"
]
}