If we have already created a docker machine instance, we can change the image source as follows:
1, Docker Toolbox
Execute docker-machine ssh [machine-name] on the Windows command line to enter VM bash
sudo vi /var/lib/boot2docker/profile
Add --registry-mirror https://xxxxxxxx.mirror.aliyuncs.com1 in the next line of --label provider=virtualbox
Restart the docker service: sudo /etc/ init.d/docker restart or restart the VM: exit to exit VM bash, execute docker-machine restart
2, Docker for Windows
## in the Windows command line
#If you are creating a new Docker Machine instance, refer to Alibaba Cloud's 1. Install/upgrade your Docker client(1 ) For users below Windows 10, it is recommended to use Docker Toolboxphp video tutorial)
2. How to use Docker acceleratordocker-machine create --engine-registry-mirror=https://xxxxxxxx.mirror.aliyuncs.com -d virtualbox default
docker-machine env default eval "$(docker-machine env default)" docker info
{ "registry-mirrors": ["https://xxxxxxxx.mirror.aliyuncs.com"] }
Docker command reference document
Dockerfile image construction reference document
Related recommendations :Docker Getting Started Tutorial
The above is the detailed content of How to modify docker image source on windows system. For more information, please follow other related articles on the PHP Chinese website!