2016-07-05 37 views
0

我有一個遠程的Docker註冊表設置。它安裝了一個爸爸的SSL證書。Docker私人註冊表 - 推送到'不安全的註冊表'仍然抱怨'未知的權威'

如果我捲曲它,我得到一個 '未知的權威' 錯誤:

curl https://example.com:5000/v2/ 

curl: (60) server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none 
More details here: http://curl.haxx.se/docs/sslcerts.html 

... 

If this HTTPS server uses a certificate signed by a CA represented in 
the bundle, the certificate verification probably failed due to a 
problem with the certificate (it might be expired, or the name might 
not match the domain name in the URL). 
If you'd like to turn off curl's verification of the certificate, use 
the -k (or --insecure) option. 

所以我然後使用 '不安全' 捲曲:

curl -k https://example.com:5000/v2 

,我得到

{} //which I guess is because there is nothing in the registry? 

檢查,我蜷縮一個不存在的端點:

curl -k https://example.com:5000/moo 

404 page not found //which is positive, as it means the -k flag is suppressing the 'unknown authority' correctly 

所以,現在我知道這是可以通過捲曲連接到註冊表我嘗試使用泊塢窗客戶端推送圖片:

docker push example.com:5000/my-image 

The push refers to a repository [example.com:5000/my-image] 
unable to ping registry endpoint https://example.com:5000/v0/ 
v2 ping attempt failed with error: Get https://example.com:5000/v2/: x509: certificate signed by unknown authority 
v1 ping attempt failed with error: Get https://example.com:5000/v1/_ping: x509: certificate signed by unknown authority 

所以我再嘗試加入「不安全取消錯誤-registry」至DOCKER_OPTS(如所解釋here):

DOCKER_OPTS = 「 - 不安全的註冊表example.com:5000」

[重啓搬運工守護進程]

它不起作用。我得到了同樣的「未知權威」警告。

首先,爲什麼Go Daddy的證書不可信?我把它安裝在nginx服務器上,並且它在瀏覽器上的'綠色欄'上工作正常。

其次,我如何獲得'不安全的註冊表'與Docker一起使用?謝謝

+0

看到[這裏](http://stackoverflow.com/questions/39121710/not-able-to-login-in-docker-private-repositry/39245158#39245158)設置碼頭註冊表與私人證書。 –

回答

0

好吧,我已經到了這個底部。

原來我並不需要修改/ etc /默認/本泊塢窗:

DOCKER_OPTS="--insecure-registry example.com:5000" 

的問題是,我在安裝所需要的註冊表中去,爸爸證書具有中級證書太。我收到的Go-爸爸如下:

domain.crt 
some-bundle.crt 

您需要

cat bundle.crt >> domain.crt 

,這樣證書鏈完整。然後它一切正常

相關問題