我要评分
获取效率
正确性
完整性
易理解

Changing the Image Source

If you cannot pull images from dockerhub.io, you are advised to configure the Docker image accelerator in advance and use other image sources to download the required Docker images.

To change the image source, perform the following steps:

  1. Create a Docker configuration file.
    1
    2
    sudo mkdir -p /etc/docker
    sudo vi /etc/docker/daemon.json
    
  2. Press i to enter the insert mode. In the opened configuration file, add (or modify) the registry-mirrors field. Replace https://<docker-mirror> with the actual image acceleration address.
    1
    2
    3
    {
    "registry-mirrors" : ["https://<docker-mirror>"]
    }
    
  3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Reload the Docker configuration for the modification to take effect.
    sudo systemctl daemon-reload
    sudo systemctl restart docker