<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[gitlab安装配置]]></title><description><![CDATA[<h1>1. 启动Gitlab容器</h1>
<pre><code># 启动容器
docker run \
 -itd  \
 -p 9980:80 \
 -p 9922:22 \
 -v /home/gitlab/etc:/etc/gitlab  \
 -v /home/gitlab/log:/var/log/gitlab \
 -v /home/gitlab/opt:/var/opt/gitlab \
 --restart always \
 --privileged=true \
 --name gitlab \
 gitlab/gitlab-ce
</code></pre>
<pre><code>#进容器内部
docker exec -it gitlab /bin/bash
 
#修改gitlab.rb
vi /etc/gitlab/gitlab.rb
 
#加入如下
#gitlab访问地址，可以写域名。如果端口不写的话默认为80端口
external_url 'http://192.168.124.194'
#ssh主机ip
gitlab_rails['gitlab_ssh_host'] = '192.168.124.194'
#ssh连接端口
gitlab_rails['gitlab_shell_ssh_port'] = 9922
 
# 让配置生效
gitlab-ctl reconfigure
</code></pre>
<pre><code># 修改http和ssh配置
vi /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml
 
  gitlab:
    host: 192.168.124.194
    port: 9980 # 这里改为9980
    https: false
</code></pre>
<pre><code>#重启gitlab 
gitlab-ctl restart
#退出容器 
exit
</code></pre>
<h2>修改root密码</h2>
<pre><code>docker exec -it &lt;容器名称&gt;bash

# 启动Ruby on Rails控制台
gitlab-rails console -e production
user = User.where(id: 1).first
#更改密码
user.password = 'secret_pass'
#确认更改密码
user.password_confirmation = 'secret_pass'
保存
user.save!
</code></pre>
]]></description><link>http://an.forum.genostack.com/topic/810/gitlab安装配置</link><generator>RSS for Node</generator><lastBuildDate>Sat, 13 Jun 2026 12:30:54 GMT</lastBuildDate><atom:link href="http://an.forum.genostack.com/topic/810.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 18 Feb 2023 06:23:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to gitlab安装配置 on Wed, 15 Nov 2023 10:27:14 GMT]]></title><description><![CDATA[<p dir="auto">大服务器gitlab</p>
<p dir="auto">docker run <br />
-itd  <br />
-p 9880:9880 <br />
-p 9822:22 <br />
-v /data_raid1/gitlab/etc:/etc/gitlab  <br />
-v /data_raid1/gitlab/log:/var/log/gitlab <br />
-v /data_raid1/gitlab/opt:/var/opt/gitlab <br />
--privileged=true <br />
twang2218/gitlab-ce-zh:latest</p>
<p dir="auto">root/Qiankun2021</p>
]]></description><link>http://an.forum.genostack.com/post/2349</link><guid isPermaLink="true">http://an.forum.genostack.com/post/2349</guid><dc:creator><![CDATA[zhanglu]]></dc:creator><pubDate>Wed, 15 Nov 2023 10:27:14 GMT</pubDate></item></channel></rss>