我正在尝试使用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,特别是源到图像,使用自定义端口?
发布于 2020-01-17 01:30:06
要在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
https://stackoverflow.com/questions/59779744
复制相似问题