Docker registry Sonatype Nexus3 Docker注册表中名称无效的存储库/映像 上下文

Docker registry Sonatype Nexus3 Docker注册表中名称无效的存储库/映像 上下文,docker-registry,nexus3,Docker Registry,Nexus3,我正在使用Sonatype Nexus3(版本3.18.1-01 OSS)中的Docker注册表功能来存储私有Docker映像 几天前,具有无效名称的图像最终出现在注册表中,导致Nexus3中的内部清理cron作业出现多次重复错误。您可以在下面的v2/_目录请求输出中看到错误的存储库名称 $ curl https://registry.example.com/v2/_catalog -i HTTP/1.1 200 OK Date: Wed, 11 Mar 2020 12:55:29 GMT S

我正在使用Sonatype Nexus3(版本3.18.1-01 OSS)中的Docker注册表功能来存储私有Docker映像

几天前,具有无效名称的图像最终出现在注册表中,导致Nexus3中的内部清理cron作业出现多次重复错误。您可以在下面的v2/_目录请求输出中看到错误的存储库名称

$ curl https://registry.example.com/v2/_catalog -i

HTTP/1.1 200 OK
Date: Wed, 11 Mar 2020 12:55:29 GMT
Server: Nexus/3.18.1-01 (OSS)
X-Content-Type-Options: nosniff
Content-Security-Policy: sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation
X-XSS-Protection: 1; mode=block
Docker-Distribution-Api-Version: registry/2.0
Content-Type: application/json
Content-Length: 2941

{
  "repositories": [
    "MiniProfiler.EF6",
    "MiniProfiler.Shared",
    ...
  ]
}
在这一点上,我不知道这些图像是否是由我的团队中的某个人推送到注册表中的,或者它们是否是某个意外blob存储问题的结果-我没有任何方法来验证这一点。有趣的事实:在同一个Nexus实例中的另一个blob存储中,有名称相同的NuGet包

故障排除步骤 我一直在尝试通过多种方法从注册表中删除错误的图像,但都没有成功

Nexus3图形用户界面 出现故障的存储库不会显示在Nexus GUI的Docker注册表浏览器中。使用Nexus的搜索功能也无法找到它们

Nexus3嵌入式OrientDB 我在OrientDB中查找与错误存储库关联的
资产
组件
类。不幸的是,Nexus的数据库中没有具有此类名称的资产或组件

Docker注册表API v2 我还试图通过Docker registry API V2删除它们,但当我尝试在错误的存储库上执行任何操作时,无效的名称格式似乎会导致问题

$ curl https://registry.example.com/v2/MiniProfiler.EF6/manifests/latest -i

HTTP/1.1 400 Bad Request
Date: Wed, 11 Mar 2020 12:58:24 GMT
Server: Nexus/3.18.1-01 (OSS)
X-Content-Type-Options: nosniff
Content-Security-Policy: sandbox allow-forms allow-modals allow-popups allow-presentation allow-scripts allow-top-navigation
X-XSS-Protection: 1; mode=block
Docker-Distribution-Api-Version: registry/2.0
Content-Type: application/json
Content-Length: 165

{
  "errors": [
    {
      "code": "NAME_INVALID",
      "message": "invalid repository name",
      "detail": [
        {
          "Name": "MiniProfiler.EF6"
        },
        {
          "Reason": "invalid path component: MiniProfiler.EF6"
        }
      ]
    }
  ]
}
Docker CLI 正如所料,Docker CLI也不喜欢无效的名称格式

$ docker pull registry.example.com/MiniProfiler.EF6
invalid reference format: repository name must be lowercase
如果我从图像名称中删除大写字母,注册表将返回404 Not Found错误

$ docker pull registry.example.com/miniprofiler.ef6
Using default tag: latest
Error response from daemon: manifest for registry.example.com/miniprofiler.ef6:latest not found: manifest unknown: manifest unknown
问题 有没有人在Nexus3中遇到过这样的问题?有没有人在另一个Docker注册表实现中遇到过这样的问题

如果有人有任何故障排除的步骤建议,我非常开放的任何事情在这一点上


我还将向Sonatype提交一个bug,以确保此情况具有良好的可见性。

感谢您的提问,它帮助解决了我的问题。我不知道答案,但我刚刚看到Nexus API上的一个完全不一致的行为(查询不存在的组件返回的名称对使用大写的组件名称无效),我看到您的大小写问题,API调用成功,所有小写组件名称正确返回“MANIFEST\u UNKNOWN”为了我的特殊情况。(查询Docker图像)感谢您的提问,它帮助解决了我的问题。我不知道答案,但我刚刚看到Nexus API上的一个完全不一致的行为(查询不存在的组件返回的名称对使用大写的组件名称无效),我看到您的大小写问题,API调用成功,所有小写组件名称正确返回“MANIFEST\u UNKNOWN”为了我的特殊情况。(查询Docker图像。)