Docker 注册表镜像未使用

2024-03-07

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

$ 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 hub 中提取,而不是从我的本地镜像中提取:

$ 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

_

$ 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 图像。

这是 Docker 错误,还是我遗漏了什么?

Docker 信息(简短):

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/

UPDATE :

执行“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://github.com/docker/docker/issues/20097,但解决方法不起作用:当我替换 --registry-mirror= 时https://nexus3.pleiade.mycomp.fr:5000 https://nexus3.pleiade.mycomp.fr:5000通过 --registry-mirror=https://docker:[电子邮件受保护]:5000 https://docker:password@nexus3.pleiade.mycomp.fr:5000

我得到完全相同的错误。

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


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

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

这是一个示例配置费利佩·C. https://github.com/phlbrz :

在 nginx docker 配置中,添加:

proxy_set_header Authorization "Basic a2luZzppc25ha2Vk";

完整示例:

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;
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Docker 注册表镜像未使用 的相关文章

随机推荐

  • 在 Visual Studio 11 Beta 中打开 MVC3 项目时出现“缺少 Web 组件”错误

    当我在 Visual Studio 11 Beta 中打开包含 MVC3 项目的解决方案时 我看到以下消息 Web 项目 Landboss Web 需要缺少 Web 组件才能运行 与视觉工作室 您想使用以下方式下载并安装它们吗 现在是 We
  • exec() 调用中非常大的 python 函数定义会导致 Django 崩溃,但不会导致直接执行的 Python 代码崩溃

    我有一个非常大 400k 行 的 Python 函数 我试图通过exec 称呼 如果我运行以下 Python 脚本 exec def blah 400k lines of IF THEN ELSE globals blah 通过从命令行调用
  • 如何在加载到 ImageView 之前调整图像大小以避免 OOM 问题

    从图库 照片中选择后 如何在加载到图像视图之前调整图像大小 否则大图像会导致 OOM 问题 SelectImageGallery setOnClickListener new View OnClickListener Override pu
  • 通过文件名将多个.csv文件导入R中[重复]

    这个问题在这里已经有答案了 我有一个包含 332 个 csv 文件的文件夹 从 001 csv 到 332 csv 它们具有相同的标头 如果我想计算文件中对象的平均值 其名称从 a csv 到 b csv 如何将文件 a a 1 a 2 b
  • 实体框架 6 无法识别 AddSqlServer()

    我正在尝试将 EF6 与 VS2015 CTP 和 ASP NET MVC 6 一起使用 它无法识别下面提到的代码startup cs这是我在使用 EF7 时添加的 public void ConfigureServices IServic
  • 请确保您的 Service Worker 文件包含以下内容:/(const precacheManifest =)\[\](;)/

    我对 React Workbox 还很陌生 我试图让我的 Electron React 应用程序能够缓存所有图像和数据 以便在离线时可用 这正是我在 YouTube 视频中想要实现的目标 14 00 到 21 00 分钟 使用 React
  • Ruby on Rails:无法在生产中注销应用程序

    我在 Heroku 上部署了一个应用程序 除了注销之外 一切正常 当我单击链接退出时 出现以下错误 您要查找的页面不存在 您可能输入了错误的地址 或者页面可能已移动 如果您是应用程序所有者 请检查日志以获取更多信息 对于用户身份验证 我当然
  • 可以容纳 64 位大小整数的完美数字幂(使用优先级队列)

    我们怎样才能打印出所有可以表示为 64 位长整数的完美幂 4 8 9 16 25 27 完美幂是一个可以写为 ab 的数字 对于整数 a并且b 2 这不是作业问题 我在算法设计书的求职面试问题部分找到了它 提示 本章是基于优先级队列的 我的
  • 使用 onbeforeunload 事件,“离开页面”时 url 发生变化

    我有一个要求 当用户付款并到达成功页面并返回时 应该将其重定向到自定义页面 因此 如果我单击浏览器后退按钮 它将显示两个选项 离开页面和留在此页面 当我单击离开页面时 它应该重定向到我的自定义页面 我发现以下链接很有用 但不适用于 离开页面
  • 将枚举值绑定到标签 XAML

    我正在使用枚举字段来跟踪程序的状态 public enum StatiMacchina InAvvio 1 Pronta 2 InLavorazione 3 InMovimento 4 InAttesa 5 InErrore 6 我想绑定跟
  • 中心引导行和跨度

    我正在尝试使用引导程序将行及其内部的跨度居中 您可以在页脚中看到它 http www divisionforty com wall http www divisionforty com wall 我希望社交网络图标位于左侧 版权位于中间 由
  • MVC 6 OpenIdConnect

    目前 我在将 MVC 应用程序从 beta 3 迁移到 4 时遇到了多个问题 其中之一与 OpenIdConnect 到 Windows Azure 进行身份验证有关 当我转到具有授权属性的页面时 该页面会停止处理并位于空白页面 而不会显示
  • 我无法以编程方式检测 angularjs 中的值变化

    我是 angularjs 的新手 我遇到了麻烦 I have html像这样 section class content div div section
  • DTO 道 POCO BO

    事实上 我对这些术语以及它们之间的关系感到非常困惑 我读过有关其中每个人的一些内容 但我不了解工作流程 DTO 数据传输对象 传输值的对象BO 业务对象 域模型中的对象 用于制作业务逻辑的对象POCO 不知道 我在维基上读过定义 但什么也没
  • Vue-i18n - 无法读取未定义的属性“配置”

    首先 我向您展示什么是有效的 在 App js 中 import router from routes js import VueI18n from vue i18n const messages en message hello hell
  • PHP静态成员不保值

    大家好 我正在编写的 WordPress 插件遇到了一个奇怪的问题 但这与 WordPress 本身无关 更多地与 PHP 有关 所以请继续阅读 以便我可以解释 WordPress 插件已连接 以便调用 init 函数 这有效 我可以确认它
  • iOS 模拟器中屏幕内容仅显示在部分屏幕上

    我的 iOS 模拟器仅将内容显示为屏幕的一部分 我该如何修复它 我正在使用 XCode 6 3 1 谢谢 你只需要重新启动它 有时会发生这种情况 强制关闭模拟器并重新启动
  • Django 中的syncdb 时内容类型过时

    当我努力的时候syncdb对于我的 django 项目 我看到以下抱怨 The following content types are stale and need to be deleted myapp Any objects relat
  • 在Java中调用Python?

    我想知道是否可以使用 Jython 从 Java 代码调用 Python 函数 还是只能从 Python 调用 Java 代码 Jython 用于 Java 平台的 Python http www jython org index html
  • Docker 注册表镜像未使用

    当我尝试从本地镜像中提取图像时 它起作用了 docker login u docker p mypassword nexus3 pleiade mycomp fr 5000 docker pull nexus3 pleiade mycomp