Home >Operation and Maintenance >Docker >How docker replaces domestic warehouse
1. Use the following command to change the pull address to the domestic mirror warehouse
$ docker pull registry.docker-cn.com/myname/myrepo:mytag
For example:
$ docker pull registry.docker-cn.com/library/ubuntu:16.04
2. Use --registry-mirror Configuring the Docker daemon
You can configure the Docker daemon to use Docker official image acceleration by default. In this way, you can speed up image pulling through the official image by default without having to specify registry.docker-cn.com every time you pull.
You can pass in the --registry-mirror parameter when the Docker daemon starts:
$ docker --registry-mirror=https://registry.docker-cn.com daemon
In order to persist the changes permanently, you can modify the /etc/docker/daemon.json file and add On the registry-mirrors key value.
{ "registry-mirrors": ["https://registry.docker-cn.com"] }
Restart Docker after saving the changes to make the configuration take effect.
Recommended tutorial: docker tutorial
The above is the detailed content of How docker replaces domestic warehouse. For more information, please follow other related articles on the PHP Chinese website!