2017-01-10 57 views
1

我正在嘗試登錄到您使用oadm工具構建的Docker註冊表。我試圖登錄使用令牌:TLS自簽名證書用於Docker的身份驗證URL

# docker login -u $(oc whoami) -e 'xxxx' -p $(oc whoami -t) 172.30.10.52:5000 
Error response from daemon: no successful auth challenge for 
https://172.30.10.52:5000/v2/ - errors: [basic auth attempt to 
https://172.30.10.52:5000/v2/ realm "openshift" failed with status: 400 Bad 
Request] 

尋找在日誌中,我可以看到這個問題是因爲我的情況下使用自簽名證書:

time="2017-01-10T00:58:42.913539516Z" level=error msg="error authorizing context: 
Get https://ld7-zko8s6q-ws:8443/oapi/v1/users/~: x509: 
certificate signed by unknown authority" 
go.version=go1.4.2 http.request.host="172.30.10.52:5000" 
http.request.id=3fa81975-3aa9-44d8-a6a8-c00ad360009c 
http.request.method=GET http.request.remoteaddr="10.1.0.1:49316" 
http.request.uri="/v2/" http.request.useragent="docker/1.10.3 go/go1.6.2 
git-commit/429be27-unsupported kernel/3.10.0-514.2.2.el7.x86_64 
os/linux arch/amd64" instance.id=2a23b229-2a0e-4734-83c4-38cb9c8a0e00 

我無論怎樣才能得到我的證書是可信的還是關閉TLS驗證?

回答

0

你可以測試insecure registry加入

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

/etc/default/docker文件或文件/etc/sysconfig/docker

但最好是add your self-signed certificate/etc/docker/certs.d/myregistrydomain.com:5000/ca.crt。並重新啓動你的Docker守護進程。
這樣,它會信任你的證書。

注意Openshift起源有一個currently open issue 1753「登記證書的私人碼頭工人登記極品機制」 參見「Can not pull image from remote node #6228」指的是Openshift官方文檔「Securing and Exposing the Registry」。