Updated on 2025-07-30 GMT+08:00

Configuring a Pull Accelerator

Due to carrier network issues, pulling images from third-party image registry (such as Docker Hub) may take a long time or even fail. SWR provides image download acceleration to speed up the download of some common open-source images.

  • The accelerator is only intended for individual developers and cannot be encapsulated for external use or used for commercial purposes.
  • In a production environment, to prevent image pull failures caused by Docker network problems, you are advised to synchronize the required images from Docker Hub to SWR and then pull them from SWR.
  • The image accelerator cannot pull images of all tags. Only common open-source images can be pulled using the image accelerator. You are advised to synchronize the required images to SWR.
  • Pull acceleration is not available for containerd.

Constraints

  • Only Huawei Cloud users can use image pull acceleration in Huawei Cloud container products.
  • Only open-source images can be pulled using the image accelerator. The acceleration may not work for all images. Use this feature with caution in production environments.
  • If a Docker container engine client is used, the Docker version must be 18.06 or later.
  • This feature is available in CN South-Guangzhou, CN North-Beijing4, CN East-Shanghai1, and CN Southwest-Guiyang1.

Procedure

  1. Log in to the SWR console.
  2. In the navigation pane, choose Image Resources > Image Center.

    Ensure that the Image Center is available in the current region. For details, see .

  3. Click Image Accelerator. In the displayed dialog box, click to copy the accelerator address.

    Figure 1 Image accelerator

  4. Log in to the server running the container engine as user root.
  5. Modify the /etc/docker/daemon.json file. If the file does not exist, manually create one. Add the following content to the file:

    vi /etc/docker/daemon.json

    {
    "registry-mirrors":[accelerator-address]
    }

    Replace [accelerator-address] with the image accelerator address copied in 3.

    Press Esc and enter :wq to save the settings and exit.

  6. Run systemctl restart docker to restart Docker.

    If the restart fails, check whether the registry-mirrors parameter is set in other locations (such as /etc/sysconfig/docker or /etc/default/docker) of the operating system. If yes, delete the parameter and restart the container engine.

  7. To verify whether the SWR image accelerator has been successfully configured, run the docker info command to check whether the value of Registry Mirrors is the SWR accelerator address. If yes, the accelerator has taken effect.

    Figure 2 Registry Mirrors information