Skip to Main Content

Docker Hub Mirror Configuration

This document provides guidelines on how to optimize the Docker Hub repository configuration to enhance the speed of image pulls.

Linux

Step 1

For systems utilizing systemd (including Ubuntu 16.04+, Debian 8+, CentOS 7), modify the /etc/docker/daemon.json configuration file by adding the following content:


{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn/"]
}

Step 2

Restart the dockerd service.


sudo systemctl restart docker

MacOS

  1. Open "Docker.app".

  2. Go to the Preferences page.

  3. Access the "Docker Engine" tab.

  4. Add "registry-mirrors" to the JSON configuration. Example:


{
..., // other content
"registry-mirrors": [
"https://docker.mirrors.ustc.edu.cn/"
]
}

Windows

Right-click the Docker icon in the system tray at the bottom right corner and select 'Settings'. In the configuration window that appears, go to 'Docker Engine' in the left-side menu. Utilizing the configuration approach common in Linux with "systemd systems", add "registry-mirrors" to the JSON configuration, then click "Apply & Restart" to save the changes and restart Docker.


{
..., // other content
"registry-mirrors": [
"https://docker.mirrors.ustc.edu.cn/"
]
}