在Azure VM上连接到存储在Nexus 3 Preview上的Docker注册表的麻烦 [英] Trouble connecting to Docker registry stored on Nexus 3 Preview on Azure VM

查看:209
本文介绍了在Azure VM上连接到存储在Nexus 3 Preview上的Docker注册表的麻烦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以基本上我无法连接到docker注册表,试图使用最新的Nexus预览。首先,我在运行Ubuntu 14.04的MS Azure云服务器上安装了Sonotype Nexus 3 Preview。让我们将这个位置称为



my-azure-site.cloudapp.net:8443/nexus 以进入Nexus界面。我从头到尾使用本指南 - https://books.sonatype .com / nexus-book / 3.0 / reference / index.html



所以我知道连接到远程Docker repo的唯一方式是通过SSL我启用了一个nexus中的HTTPS,如使用8443端口所示。然后,我创建了一个名为docker-hub的Docker代理服务器,以便能够从Docker Central Hub中拉出图像,如本指南第8.3节所述。 Nexus正在显示repo有一个URL



h-ttps://my-azure-site.cloudapp.net:8443 / nexus / repository / docker-hub /



然后,我创建了一个名为docker-mySoftware的私人托管回购站,其中有一个HTTPS端口连接器端口 18444 ,如本指南第8.4节所述,Nexus正在显示URL为



h-ttps://my-azure-site.cloudapp.net:8443 / nexus / repository / docker-mySoftware /



然后,我创建了一个名为docker的群组repo,其中包含上述2,HTTPS导轨连接器端口为 18443 ,如本指南第8.5节所述,Nexus将URL显示为



h-ttps://my-azure-site.cloudapp.net:8443 / nexus / repository / docker-all /



运行第8.7节所述的以下内容,以使用我的本地docker客户端测试代理,还在我的物理笔记本电脑上运行ubuntu。



sudo docker搜索my-azure-site。 cloudapp.net:18443/postgres



我有东西说有一个ca证书为my-azure-site.net:18443但不是我的天蓝色网站。 cloudapp.net:18443所以我使用keytool重新创建了证书,以包含cloudapp部分。现在,当我重试时,我得到



守护进程的错误响应:意外的状态码404



顺便说一下忘了提到我预先在Azure控制台上打开了端口18444和18443。



我尝试重新创建repos,重建索引代理服务器,在nexus天蓝云上重新创建证书,使用在我的Docker客户端机器上,希望能够获得所有这些认证的东西,但是仍然是没有运气。我尝试过不同的URL组合,如



sudo docker search my-azure-site.cloudapp.net:18443/nexus/postgres和
h-ttps ://my-azure-site.cloudapp.net:8443 / nexus / repository / docker-all / nexus等。



我只想要一些新的想法试试或者其他人遇到这个问题,原来是愚蠢的事情。



谢谢!

解决方案

正确识别设置上下文路径导致问题。原来是一个bug,现在已经修复了。 Nexus 3的下一个版本(里程碑6)将包括该修复程序,并允许您使用上下文路径。



但请记住,上下文路径不会成为部分的Docker的URL,因为docker注册表格式,因此docker客户端不支持上下文路径。因此,对于Docker的具体使用情况,您将继续使用已记录的端口。



更新:里程碑6版本已经发布并包含相关修复程序。 b $ b

So basically i'm having trouble connecting to a docker registry im trying to make using the latest Nexus preview. First I installed Sonotype Nexus 3 Preview on a MS Azure cloud server running Ubuntu 14.04 trusty. Lets call this location

my-azure-site.cloudapp.net:8443/nexus to get to the Nexus UI. I am using this guide from start to finish - https://books.sonatype.com/nexus-book/3.0/reference/index.html

So I know the only way to connect to a remote Docker repo is through SSL so I enabled HTTPS in nexus as shown by using the 8443 port. I then created a Docker proxy repo named docker-hub to be able to pull images from the Docker Central Hub as outlined in section 8.3 of the guide. Nexus is showing that repo has a URL of

h-ttps://my-azure-site.cloudapp.net:8443/nexus/repository/docker-hub/

Then I created a private hosted repo called docker-mySoftware with a HTTPS docker connector port of 18444 as outlined in section 8.4 of the guide and Nexus is showing the URL as

h-ttps://my-azure-site.cloudapp.net:8443/nexus/repository/docker-mySoftware/

Then I created a group repo named docker-all that contains the above 2 with a HTTPS docker connector port of 18443 as outlined in section 8.5 of the guide and Nexus is showing the URL as

h-ttps://my-azure-site.cloudapp.net:8443/nexus/repository/docker-all/

At first when I tried to run the following as outlined in section 8.7 to test out the proxy using my local docker client also running ubuntu on my physical laptop

sudo docker search my-azure-site.cloudapp.net:18443/postgres

I got something saying there is a ca certificate for my-azure-site.net:18443 but not for my-azure-site.cloudapp.net:18443 so I recreated the certificate using keytool to include the cloudapp part. Now when I retried it im getting

Error response from daemon: Unexpected status code 404

By the way I forgot to mention I opened up ports 18444 and 18443 on the Azure console beforehand.

I tried recreating the repos, reindexing proxy repo, recreating certificates on the nexus azure cloud, using

sudo docker -d --insecure-registry my-azure-site.cloudapp.net:18443 on my docker client machine to hopefully get around all this certification stuff but still no luck. I tried different combinations of the URL such as

sudo docker search my-azure-site.cloudapp.net:18443/nexus/postgres and h-ttps://my-azure-site.cloudapp.net:8443/nexus/repository/docker-all/nexus etc.

I just want some fresh ideas on what else to try out or if anyone else ran into this problem and turned out to be something silly.

Thanks!

解决方案

As you correctly identified setting the context-path caused the problem. This turned out to be a bug and it has been fixed now. The next release of Nexus 3 (Milestone 6) will include that fix and allow you to use the context path.

However keep in mind that the context path will not be part of the URLs for Docker, since the docker registry format and therefore also the docker client do NOT support context paths. So for Docker specific usage you will continue to use the ports as documented.

Update: The milestone 6 version has been released and contains the relevant fix.

这篇关于在Azure VM上连接到存储在Nexus 3 Preview上的Docker注册表的麻烦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆