Git/gitlab:修订间差异
来自康健生活
创建页面,内容为“* 群晖gitlab * aliyun备份到群晖 * * centos gitlab docker安装gitlab” |
无编辑摘要 |
||
| 第4行: | 第4行: | ||
* [[/centos_gitlab|centos gitlab]] | * [[/centos_gitlab|centos gitlab]] | ||
[[/dockerinstallgitlab|docker安装gitlab]] | [[/dockerinstallgitlab|docker安装gitlab]] | ||
GitLab 容器的 22 端口,与宿主机的 30011 端口进行映射。 | |||
在 docker 上登陆 gitlab 使用命令: | |||
<syntaxhighlight lang="bash"> | |||
git clone ssh://git@192.168.50.3:30011/root/basemvc.git</syntaxhighlight> | |||
查看 IP Forward 功能 | |||
<syntaxhighlight lang="bash"> | |||
sysctl -q net.ipv4.ip_forward</syntaxhighlight> | |||
<blockquote><pre> | |||
net.ipv4.ip_forward = 0</pre></blockquote> | |||
0:未开启,1:已开启 | |||
<syntaxhighlight lang="bash"> | |||
sysctl -w net.ipv4.ip_forward=1</syntaxhighlight> | |||
== 解决办法 == | |||
在网上查找了一下资料,发现垃圾信息一大堆,磕磕绊绊找到两个关键点。修改 gitlab.rb 配置文件(不管是容器还是其他,只有修改唯一配置文件才是正解)。 | |||
<syntaxhighlight lang="rb" highlight="7,12"> | |||
# ... | |||
## GitLab URL | |||
##! URL on which GitLab will be reachable. | |||
##! For more details on configuring external_url see: | |||
##! https://docs.gitlab.com/omnibus/settings/configuration.html#configuring-the-external-url-for-gitlab | |||
# external_url 'GENERATED_EXTERNAL_URL' | |||
external_url 'http://kangjian.xyz' | |||
## Roles for multi-instance GitLab | |||
# ... | |||
### GitLab Shell settings for GitLab | |||
# gitlab_rails['gitlab_shell_ssh_port'] = 22 | |||
gitlab_rails['gitlab_shell_ssh_port'] = 30011 | |||
# gitlab_rails['gitlab_shell_git_timeout'] = 800 | |||
# ... | |||
</syntaxhighlight> | |||
重启容器之后,效果如下: | |||
[[文件:Gitlab ssh port 1.png|500px|无框|无|Gitlab ssh port 1]] | |||
这样就可直接 copy 命令了。 | |||