编辑 /etc/sysconfig/docker 如下:


OPTIONS='--selinux-enabled --add-registry=r6w9c7qa.mirror.aliyuncs.com/library'
DOCKER_CERT_PATH=/etc/docker



重启docker服务


# service docker restart
Redirecting to /bin/systemctl restart  docker.service


测试:

# docker pull swarm
Using default tag: latest
Trying to pull repository r6w9c7qa.mirror.aliyuncs.com/library/swarm ... latest: Pulling from library/swarm
f47b06a02bf0: Pull complete 
7531748b575b: Pull complete 
5b2f47236341: Pull complete 
b52213735b24: Pull complete 
441f79a26fbd: Pull complete 
a63d3a5a9507: Pull complete 
c9221c4fa910: Pull complete 
b77f6787bbf5: Pull complete 
Digest: sha256:b5d6768ae331cfc21c396382e96db5778709f3b313cb555b5c683e5e7eedc7c8
Status: Downloaded newer image for r6w9c7qa.mirror.aliyuncs.com/library/swarm:latest

docker版本:


# docker -v
Docker version 1.8.2-fc22, build cb216be/1.8.2


Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐