允许访问gitlab.com



我试图在迷你档创建新的应用程序。第一个命令是:

oc new-app https://gitlab.com/practical-openshift/hello-world.git

结果:

--> Found container image 2b6ec7e (10 hours old) from Docker Hub for "golang:alpine"
* An image stream tag will be created as "golang:alpine" that will track the source image
* A Docker build using source code from https://gitlab.com/practical-openshift/hello-world.git will be created
* The resulting image will be pushed to image stream tag "hello-world:latest"
* Every time "golang:alpine" changes a new build will be triggered
--> Creating resources ...
imagestream.image.openshift.io "golang" created
imagestream.image.openshift.io "hello-world" created
buildconfig.build.openshift.io "hello-world" created
deployment.apps "hello-world" created
service "hello-world" created
--> Success
Build scheduled, use 'oc logs -f buildconfig/hello-world' to track its progress.
Application is not exposed. You can expose services to the outside world by executing one or more of the commands below:
'oc expose service/hello-world'
Run 'oc status' to view your app.

所以,当我运行时:

oc logs -f buildconfig/hello-world

I get error:

Cloning "https://gitlab.com/practical-openshift/hello-world.git" ...
WARNING: timed out waiting for git server, will wait 1m4s
error: fatal: unable to access 'https://gitlab.com/practical-openshift/hello-world.git/': Could not resolve host: gitlab.com; Unknown error

我试着运行这个:

git config --global --unset http.proxy
git config --global --unset https.proxy

但是没有用。那么,我该如何解决我的问题呢?

尝试使用hostAlias。添加到你的buildconfig文件

spec:
hostAliases:
- ip: "172.65.251.78"
hostnames:
- "gitlab.com"

如果它不工作,将此添加到您的hosts文件。

最新更新