Using Docker Hub Accelerators

Last updated: 2018-09-18 22:35:28

PDF

Source address of Docker: https://mirror.ccs.tencentyun.com

TKE Cluster CVM

When a node is created, Docker service is installed and image is configured automatically, without the need of manual configuration. The configuration items are as follows:

[root@VM_1_2_centos ~]# cat /etc/docker/dockerd 
IPTABLES="--iptables=false"
STORAGE_DRIVER="--storage-driver=overlay2"
IP_MASQ="--ip-masq=false"
LOG_LEVEL="--log-level=warn"
REGISTRY_MIRROR="--registry-mirror=https://mirror.ccs.tencentyun.com"

CVM Configuration

Linux:

  • Applicable to Ubuntu14.04, Debian, CentOS6, Fedora and OpenSUSE. For other versions, the configuration may be slightly different.
    Docker configuration file /etc/default/docker is modified as follows:
    DOCKER_OPTS="--registry-mirror=https://mirror.ccs.tencentyun.com"
    
  • Applicable to Centos7.
    The Docker configuration file vi /etc/sysconfig/docker is modified as follows:
    OPTIONS='--registry-mirror=https://mirror.ccs.tencentyun.com'
    

    Note:
    Only Docker 1.3.2 or above supports Docker Hub Mirror mechanism. If you have not installed Docker or the installed version is too low, please install it or upgrade your version.

Windows:

If you are using Boot2Docker, go to Boot2Docker Start Shell and execute the following command:

sudo su echo "EXTRA_ARGS=\"-registry-mirror=https://mirror.ccs.tencentyun.com"">> /var/lib/boot2docker/profile  exit #  RestartBoot2Docker

Launching Docker

Execute the following command:

sudo service docker start