我尝试使用docker 1.8在注册表2.1.1版本中发布的pull through缓存docker.在CentOS7.1上但是,我遵循这些网站,并没有充当镜像,任何输入将非常感激.我希望这是配置注册表服务和传递docker守护程序参数的正确方法.
网站:https : //github.com/docker/distribution/blob/master/docs/mirror.md http://docs.master.dockerproject.org/articles/registry_mirror/
脚步:
我添加了参数以传递给docker守护进程并重新启动它:
# /etc/sysconfig/docker
#
# Other arguments to pass to the docker daemon process
# These will be parsed by the sysv initscript and appended
# to the arguments list passed to docker -d
OPTIONS="--registry-mirror=http://localhost:5000"
Run Code Online (Sandbox Code Playgroud)添加了注册表配置并挂载到容器:
version: 0.1
log:
fields:
service: registry
storage:
cache:
blobdescriptor: inmemory
filesystem:
rootdirectory: /var/lib/registry
http:
addr: :5000
headers:
X-Content-Type-Options: [nosniff]
health:
storagedriver:
enabled: true
interval: 10s
threshold: 3
proxy:
remoteurl: https://registry-1.docker.io
Run Code Online (Sandbox Code Playgroud)启动注册表容器
docker run -d -p …Run Code Online (Sandbox Code Playgroud)