2016-07-16 102 views
1

是新openshift原點openshift,我試圖進行基本設置。我的Windows筆記本電腦中安裝了我的Ubuntu VM上的docker和openshift。我沒有任何問題在單獨使用docker和從本地註冊表中推送或拉出。我在openshift原點使用oc new-app命令時遇到問題。與當地碼頭工人註冊表

我有一個本地註冊表運行在我的VM

docker ps 
CONTAINER ID  IMAGE    COMMAND     CREATED    STATUS    PORTS           NAMES 
26d3a527398d  registry:2   "/bin/registry serve " 16 minutes ago  Up 16 minutes  0.0.0.0:443->443/tcp, 0.0.0.0:5000->5000/tcp registry 

,我已經推了圖像此註冊表

docker images myregistry.com:5000/ubuntu 
REPOSITORY     TAG     IMAGE ID   CREATED    SIZE 
myregistry.com:5000/ubuntu latest    cf62323fa025  7 days ago   125 MB 

當我嘗試在openshift中使用這張圖片,下面我越來越錯誤

./oc new-app --docker-image=myregistry.com:5000/ubuntu 
error: can't look up Docker image "myregistry.com:5000/ubuntu": Internal error occurred: Get https://myregistry.com:5000/v2/: http: server gave HTTP response to HTTPS client 
error: no match for "myregistry.com:5000/ubuntu" 

The 'oc new-app' command will match arguments to the following types: 

    1. Images tagged into image streams in the current project or the 'openshift' project 
    - if you don't specify a tag, we'll add ':latest' 
    2. Images in the Docker Hub, on remote registries, or on the local Docker engine 
    3. Templates in the current project or the 'openshift' project 
    4. Git repository URLs or local paths that point to Git repositories 

--allow-missing-images can be used to point to an image that does not exist yet. 

See 'oc new-app -h' for examples. 

這是否與我的DNS解析有關?我如何使用我的本地註冊表我openshift起源

+0

是從哪兒OpenShift運行的VM內''myregistry.com''分辨? –

+0

你是如何安裝OpenShift的? (您是否在Docker容器中運行它?)因爲高級安裝需要RHEL或CentOS – lvthillo

回答

1

裏面的代碼在​​提到:

case strings.Contains(secError.Error(), "tls: oversized record received"), 
    strings.Contains(secError.Error(), "server gave HTTP response to HTTPS"): 
      r.Debug("DP1015", "docker-registry not secured; falling back to cleartext connection") 

Issue 6516提到:

,如果你的註冊表需要身份驗證,那麼這就是問題所在。新應用程序無法從需要身份驗證的註冊表中提取圖像(這存在一個存在的問題),因此就其而言,該註冊表中不存在該圖像。

Issue 6540(OC 1.1.1)應該解決此問題:

new-app可以使用,似乎只存在於本地(因爲新的應用程序不能訪問註冊表)的圖像。它將繼續定義預期的openshift對象(deploymentconfig等)並引用該圖像。
如果節點也無法拉取圖像,則部署最終仍會失敗。 (但不像new-appnodes能夠從安全登記拉動圖片)


其設置爲 「How to Setup a DNS Server for a Home Lab on Ubuntu 14.04

我加入了DNS和--insecure-registry選項DNS的OP Raghavan報告in the comments/etc/default/docker文件爲

DOCKER_OPTS=--dns 10.0.3.1 --insecure-registry ns1.myregistry.com:5000 

這裏10.0.3.1是我的DNS服務器,並在服務器裏泊塢窗註冊表與主機運行的ns1.myregistry.com

+0

感謝您的輸入。問題出在我的DNS解析上。 – Raghavan

+0

@Raghavan你是如何解決DNS解析的? – VonC

+0

我提出了一個使用此鏈接的DNS服務器 - http://frankhinek.com/how-to-setup-a-dns-server-for-a-home-lab-on-ubuntu-14-04/並添加了在/ etc/default/docker文件中的DNS和--insecure-registry選項爲DOCKER_OPTS = - dns 10.0.3.1 --insecure-registry ns1.myregistry.com:5000「。這裏10.0.3.1是我的DNS服務器,也是服務器,其中碼頭註冊表運行時的主機名爲ns1.myregistry.com – Raghavan

相關問題