0

我正在尝试使用 OpenShift s2i 构建来构建映像,从非标准端口(端口 222)上的 git 存储库中提取源代码。

我认为这就像在 git repo url 中指定端口一样简单,但这似乎不起作用。当我运行它时,我得到以下信息:

Cloning "git@ssh.gitlab.intnerldomain.com:222/myorg/myproject.git" ...
WARNING: timed out waiting for git server, will wait 1m4s
error: ssh: connect to host ssh.gitlab.intnerldomain.com port 22: Connection timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

请注意,git url 包含:222但错误消息状态,它正在使用端口 22。

我如何告诉 Openshift,特别是源到图像,使用自定义端口?

4

1 回答 1

1

要在 Git 的 ssh URL 中使用端口,请使用ssh://user@host:port/path/to/repo.git语法。速记user@host:path语法不允许端口插入。您使用的 URL 相当于:

ssh://git@ssh.gitlab.intnerldomain.com/222/myorg/myproject.git
于 2020-01-17T01:30:05.813 回答