After Docker is installed, its official image warehouse is used by default. However, this warehouse is not very friendly to domestic developers and is very slow. Therefore, we need to change this before officially using docker. The default image repository.
1. Modify the file /etc/docker/daemon.json (if the file does not exist, you can create it directly) and fill in the following content:
{ "registry-mirrors": [ "https://registry.docker-cn.com" ] }
2. Restart the Docker service. You need to confirm that the restart is successful.
systemctl restart docker # 重启docker服务 systemctl status docker # 确认docker服务正常运行
3. Confirm that the new mirror warehouse configuration is successful.
docker info
From the printed information, find the option "Registry Mirrors" , confirm that it is the address of the mirror warehouse we configured. If it is not or does not have this option, it means that the configuration of the mirror warehouse failed and needs to be done again!
Recommended tutorial: docker tutorial
The above is the detailed content of How to change the image warehouse in docker. For more information, please follow other related articles on the PHP Chinese website!