首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Openshift 3.11源代码到镜像(s2i)构建,不使用标准ssh端口

Openshift 3.11源代码到镜像(s2i)构建,不使用标准ssh端口
EN

Stack Overflow用户
提问于 2020-01-17 00:37:01
回答 1查看 65关注 0票数 0

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

我以为这会像在git repo url中指定端口一样简单,但是这似乎不起作用。当我运行这段代码时,我得到了以下结果:

代码语言:javascript
运行
AI代码解释
复制
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,特别是源到图像,使用自定义端口?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-01-17 01:30:06

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

代码语言:javascript
运行
AI代码解释
复制
ssh://git@ssh.gitlab.intnerldomain.com/222/myorg/myproject.git
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59779744

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档