我尝试了在Registry2.1.1版本中发布的贯穿缓存停靠器,其中包含了docker1.8。然而,在CentOS7.1,我跟踪这些网站,它不作为镜像,任何投入将是非常感谢的。我希望这是配置注册表服务和传递docker守护进程参数的正确方法。
网站:https://github.com/docker/distribution/blob/master/docs/mirror.md mirror/
步骤:
发布于 2021-10-01 07:44:42
问题中的API URL是错误的。正确的办法是:
$ curl http://localhost:5000/v2/library/docker/tags/list
{"name":"library/docker","tags":["1","1-dind","1-experimental","1-experimental-dind","1-e...
对于名称中没有斜杠的图像,请使用library
前缀。如果您的注册表正在响应,它应该可以工作。
在我的例子中,我是这样运行的:
docker run \
-d \
-p 5000:5000 \
--restart=always \
--name docker-through-cache \
-v "$PWD/docker-proxy-config.yml:/etc/docker/registry/config.yml" \
-v /var/docker-registry:/var/docker-registry \
registry:2
配置:
version: 0.1
proxy:
remoteurl: https://registry-1.docker.io
storage:
filesystem:
rootdirectory: /var/docker-registry
maxthreads: 100
http:
addr: 0.0.0.0:5000
log:
accesslog:
disabled: true
level: info
formatter: text
fields:
service: registry
Ubuntu上的客户端配置位于/etc/docker/daemon.json
文件中:
{
"registry-mirrors": ["http://127.0.0.1:5000"]
}
当您的客户端配置正确时,存储库日志中将显示以下日志:
time="2021-10-01T07:13:47.130717525Z" level=info msg="response completed" go.version=go1.11.2 http.request.host="127.0.0.1:5000" http.request.id=d9329952-12db-427e-b2c6-346aa8c96425 http.request.method=GET http.request.remoteaddr="172.17.0.1:46142" http.request.uri="/v2/library/docker/blobs/sha256:f7a4137012260e097fc6b4bf6d75ba3b193acb399fb1276687303dea63ba519c" http.request.useragent="docker/20.10.8 go/go1.16.6 git-commit/75249d8 kernel/5.11.0-34-generic os/linux arch/amd64 UpstreamClient(Docker-Client/20.10.8 \(linux\))" http.response.contenttype="application/octet-stream" http.response.duration=451.36281ms http.response.status=200 http.response.written=61283898
当客户端下载一个层(查看blob哈希)时,就会出现这个特定的日志:
$ docker pull docker:20.10.8-dind
20.10.8-dind: Pulling from library/docker
...
f7a413701226: Pull complete
...
发布于 2015-12-18 19:54:36
我用了..。
docker run -p 5000:5000 \
-e STANDALONE=false \
-e MIRROR_SOURCE=https://registry-1.docker.io \
-e MIRROR_SOURCE_INDEX=https://index.docker.io \
-e "REGISTRY_LOG_LEVEL=debug" \
-e "REGISTRY_REDIRECT_DISABLE=true" \
-v /var/lib/registry:/var/lib/registry \
--name registry-cache-latest \
registry
。。然后指向http服务器的注册镜像,而不是https。
https://stackoverflow.com/questions/32531048
复制相似问题