After installing Docker’s toolbox in local windows, how to replace the mirror source with the mirror source of Aliyun or daocloud?

  docker, question

After installing Docker’s Toolbox in local windows, how to replace the default Docker Hub mirror source with Aliyun or daocloud mirror source?

For an instance of Docker Machine that has been created, replace the mirror source as follows

  1. Execute on windows Command Linedocker-machine ssh [machine-name]Enter VM bash

  2. sudo vi /var/lib/boot2docker/profile

  3. In--label provider=virtualboxAdd to the next line of--registry-mirror https://xxxxxxxx.mirror.aliyuncs.com1

  4. Restart the docker service:sudo /etc/init.d/docker restartOr restart the VM:Exit exits VM bash and executes docker-machine restart on the windows command line.

If you are creating a new Docker Machine instance, refer to Aliyun’sOperation document

Install/upgrade your Docker client

How to Use Docker Accelerator

  1. Create a Linux virtual machine with a Docker environment installed, specify the machine name as default, and configure the Docker accelerator address.

    docker-machine create --engine-registry-mirror=[^2] -d virtualbox default
  2. View the environment configuration of the machine, configure it locally, and access the Docker service through the Docker client.

    docker-machine env default
     eval "$(docker-machine env default)"
     docker info

Relevant documents

Docker command reference documentation
Dockerfile mirror build reference document

  1. https://xxxxxxxx.mirror.aliyuncs.comYou need to replace it with your mirror accelerator address at the cloud service provider.