首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >码头注册镜像未使用

码头注册镜像未使用
EN

Stack Overflow用户
提问于 2017-02-09 17:41:00
回答 5查看 16K关注 0票数 9

当我试图从我的本地镜像中提取一个图像时,它起作用了:

代码语言:javascript
复制
$ docker login -u docker -p mypassword nexus3.pleiade.mycomp.fr:5000
$ docker pull nexus3.pleiade.mycomp.fr:5000/hello-world
Using default tag: latest
latest: Pulling from **hello-world**
78445dd45222: Pull complete 
Digest: sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
Status: Downloaded newer image for **nexus3.pleiade.mycomp.fr:5000/hello-world:latest**

但是,当我想使用这个注册表作为镜像时,它就被忽略了,图像总是从web Docker中心,而不是从我的本地镜像中提取的:

代码语言:javascript
复制
$ ps -ef | grep docker
/usr/bin/dockerd -H fd:// --storage-driver=overlay2 --registry-mirror=https://nexus3.pleiade.mycomp.fr:5000

$ docker info
Registry Mirrors:
 https://nexus3.pleiade.mycomp.fr:5000/

$ docker rmi nexus3.pleiade.mycomp.fr:5000/hello-world

_

代码语言:javascript
复制
$ docker pull hello-world
Using default tag: latest
latest: Pulling from **library/hello-world**
78445dd45222: Pull complete 
Digest: sha256:c5515758d4c5e1e838e9cd307f6c6a0d620b5e07e6f927b07d05f6d12a1ac8d7
Status: Downloaded newer image for **hello-world:latest**

我确信它不使用我的镜像,因为当我取消代理设置时,它就无法达到hello-world映像。

是码头的窃听器,还是我漏掉了什么?

码头信息(简称):

代码语言:javascript
复制
Server Version: 1.13.1
Storage Driver: overlay2
(...)
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.8.0-37-generic
Operating System: Ubuntu 16.10
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 15.67 GiB
(...)
Registry Mirrors:
 https://nexus3.pleiade.edf.fr:5000/

更新

在执行"journalctl -xe“时,我可以看到一些有用的信息:

level=error msg="Attempting next endpoint for pull after error: Get https://nexus3.pleiade.mycomp.fr:5000/v2/library/hello-world/manifests/latest: no basic auth credentials"

它看起来与:https://github.com/docker/docker/issues/20097有关,但解决方法不起作用:当我将--注册表-镜像=https://nexus3.pleiade.mycomp.fr:5000替换为--注册表-镜像=https://docker:password@nexus3.pleiade.mycomp.fr:5000

我也犯了同样的错误。

如果重要的话,nexus使用的是一个自签名证书,该证书已经复制到/etc/docker/certs.d/nexus3.pleiade.mycomp.fr:5000/ca.crt,并且允许通过"docker登录“登录。

EN

回答 5

Stack Overflow用户

回答已采纳

发布于 2017-03-13 07:22:15

这是一个码头错误:https://github.com/docker/docker/issues/30880

解决方法是设置https反向代理,设置硬编码的身份验证头。

下面是来自费利佩C.的一个示例配置:

在nginx docker配置中,添加:

代码语言:javascript
复制
proxy_set_header Authorization "Basic a2luZzppc25ha2Vk";

完整的例子:

代码语言:javascript
复制
server {
    listen *:443 ssl http2;
    server_name docker.domain.blah.net;
    ssl on;
    include ssl/domain.blah.net.conf;
    # allow large uploads of files - refer to nginx documentation
    client_max_body_size 0;
    chunked_transfer_encoding on;
    location / {
        proxy_pass http://127.0.0.1:8083/;
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Authorization "Basic YWRtaW46YWRtaW4xMjM=";

        #proxy_set_header X-Forwarded-Proto "https";
    }
}

server {
    listen *:80;
    server_name docker.domain.blah.net;
    return 301 https://$server_name$request_uri;
}
票数 5
EN

Stack Overflow用户

发布于 2021-02-25 08:27:43

另一种方法是停靠注销其他服务器。并启用注册表配置,允许匿名停靠器拉( docker令牌域需要)。

票数 1
EN

Stack Overflow用户

发布于 2017-03-17 15:09:29

我添加了一个/etc/docker/daemon.json:

代码语言:javascript
复制
{
    "registry-mirrors": [ "nexus3.pleiade.mycomp.fr" ],
    "max-concurrent-downloads": 20
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42143395

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档