<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>gitlab Archives - 原立方</title>
	<atom:link href="https://www.atomic-cube.cn/category/gitlab/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.atomic-cube.cn/category/gitlab/</link>
	<description>技术栈的流动-从零到∞</description>
	<lastBuildDate>Fri, 01 May 2026 08:32:10 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>
	<item>
		<title>轻量级 Git 神器 Gitea：从安装到使用一篇就够</title>
		<link>https://www.atomic-cube.cn/%e8%bd%bb%e9%87%8f%e7%ba%a7-git-%e7%a5%9e%e5%99%a8-gitea%ef%bc%9a%e4%bb%8e%e5%ae%89%e8%a3%85%e5%88%b0%e4%bd%bf%e7%94%a8%e4%b8%80%e7%af%87%e5%b0%b1%e5%a4%9f/</link>
					<comments>https://www.atomic-cube.cn/%e8%bd%bb%e9%87%8f%e7%ba%a7-git-%e7%a5%9e%e5%99%a8-gitea%ef%bc%9a%e4%bb%8e%e5%ae%89%e8%a3%85%e5%88%b0%e4%bd%bf%e7%94%a8%e4%b8%80%e7%af%87%e5%b0%b1%e5%a4%9f/#respond</comments>
		
		<dc:creator><![CDATA[evans]]></dc:creator>
		<pubDate>Sun, 19 Apr 2026 01:55:56 +0000</pubDate>
				<category><![CDATA[Docker]]></category>
		<category><![CDATA[gitea]]></category>
		<category><![CDATA[gitlab]]></category>
		<category><![CDATA[技术文章]]></category>
		<category><![CDATA[docker]]></category>
		<guid isPermaLink="false">https://www.atomic-cube.cn/?p=1459</guid>

					<description><![CDATA[<p>只需 1 个二进制文件、150MB 内存，就能在服务器上拥有一个功能完备的 Git 代码托管平台。</p>
<p>The post <a href="https://www.atomic-cube.cn/%e8%bd%bb%e9%87%8f%e7%ba%a7-git-%e7%a5%9e%e5%99%a8-gitea%ef%bc%9a%e4%bb%8e%e5%ae%89%e8%a3%85%e5%88%b0%e4%bd%bf%e7%94%a8%e4%b8%80%e7%af%87%e5%b0%b1%e5%a4%9f/">轻量级 Git 神器 Gitea：从安装到使用一篇就够</a> appeared first on <a href="https://www.atomic-cube.cn">原立方</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">Gitea 是什么？</h2>



<p class="wp-block-paragraph">Gitea 是一个用 Go 语言编写的轻量级自托管 Git 服务，目标是“极易安装、运行快速、体验良好”<a href="https://gitea.cn/gitea/gitea/blame/commit/5b6258a0b94737ec3db1ce418d0c933512a71f78/docs/content/index.zh-cn.md" target="_blank" rel="noreferrer noopener"></a>。它集成了代码托管、Issue 跟踪、Pull Request、Wiki、CI/CD 等核心功能，界面风格和操作逻辑与 GitHub 高度相似，学习成本几乎为零<a href="https://gitea.cn/gitea/gitea/blame/commit/5b6258a0b94737ec3db1ce418d0c933512a71f78/docs/content/index.zh-cn.md" target="_blank" rel="noreferrer noopener"></a>。</p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="568" height="1024" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/gitea1-568x1024.png" alt="" class="wp-image-1460" srcset="https://www.atomic-cube.cn/wp-content/uploads/2026/04/gitea1-568x1024.png 568w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/gitea1-166x300.png 166w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/gitea1-768x1384.png 768w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/gitea1-852x1536.png 852w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/gitea1.png 1034w" sizes="(max-width: 568px) 100vw, 568px" /></figure>



<p class="wp-block-paragraph">它的最大亮点是 <strong>极致的轻量</strong>：</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="351" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/gitea2-1024x351.png" alt="" class="wp-image-1461" srcset="https://www.atomic-cube.cn/wp-content/uploads/2026/04/gitea2-1024x351.png 1024w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/gitea2-300x103.png 300w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/gitea2-768x263.png 768w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/gitea2-1536x527.png 1536w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/gitea2-2048x702.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">一个真实的迁移案例显示：团队从 GitLab 切换到 Gitea 后，内存占用从 <strong>10GB 骤降到约 600MB</strong><a href="https://cloud.tencent.com.cn/developer/article/2601737" target="_blank" rel="noreferrer noopener"></a>。这意味着即使在 1 核 2G 的轻量云服务器或树莓派上，它也能流畅运行<a href="https://www.cnblogs.com/huangSir-devops/p/18940063" target="_blank" rel="noreferrer noopener"></a>。</p>



<p class="wp-block-paragraph"><a href="https://about.gitea.com/products/gitea" target="_blank" rel="noopener nofollow" title="">https://about.gitea.com/products/gitea</a></p>



<p class="wp-block-paragraph"><a href="https://github.com/go-gitea/gitea" target="_blank" rel="noopener nofollow" title="">https://github.com/go-gitea/gitea</a></p>



<h2 class="wp-block-heading">三步部署：Docker 快速上手</h2>



<p class="wp-block-paragraph">推荐使用 Docker Compose 部署，5 分钟就能跑起来。</p>



<p class="wp-block-paragraph"><strong>第一步：创建项目目录</strong></p>



<pre class="wp-block-code"><code>mkdir -p /data/gitea &amp;&amp; cd /data/gitea</code></pre>



<p class="wp-block-paragraph"><strong>第二步：编写 docker-compose.yml</strong></p>



<pre class="wp-block-code"><code>version: "3"

services:
  server:
    image: gitea/gitea:latest
    container_name: gitea
    environment:
      - USER_UID=1000
      - USER_GID=1000
    restart: always
    volumes:
      - ./gitea:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "3000:3000"
      - "222:22"</code></pre>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p class="wp-block-paragraph"><strong>💡 说明</strong>：此配置使用 SQLite 作为数据库，无需额外安装。如果需要团队使用，建议改用 MySQL 或 PostgreSQL<a href="https://docs.gitea.com/zh-tw/next/installation/install-with-docker#__docusaurus_skipToContent_fallback" target="_blank" rel="noreferrer noopener"></a>。</p>
</blockquote>



<p class="wp-block-paragraph"><strong>第三步：启动并完成初始化</strong></p>



<pre class="wp-block-code"><code>docker-compose up -d</code></pre>



<p class="wp-block-paragraph">浏览器访问 <code>http://你的服务器IP:3000</code>，按照向导完成首次配置即可。<strong>注意</strong>：第一个注册的用户将自动成为平台管理员<a href="https://developer.aliyun.com/article/1657980" target="_blank" rel="noreferrer noopener"></a></p>



<h2 class="wp-block-heading">日常使用</h2>



<h3 class="wp-block-heading">创建仓库</h3>



<p class="wp-block-paragraph">登录后，点击右上角的“+”号 → 选择“New Repository”，填写名称、描述，选择公开/私有权限即可</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="70" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/gitea3-1024x70.png" alt="" class="wp-image-1462" srcset="https://www.atomic-cube.cn/wp-content/uploads/2026/04/gitea3-1024x70.png 1024w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/gitea3-300x20.png 300w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/gitea3-768x52.png 768w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/gitea3-1536x105.png 1536w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/gitea3-2048x140.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<h3 class="wp-block-heading">克隆与推送代码</h3>



<p class="wp-block-paragraph">首次推送前需要先生成 Access Token（Personal Access Token）：点击头像 → Settings → Applications → Generate Token，记下生成的 Token<a href="https://cloud.tencent.com.cn/developer/article/2601737" target="_blank" rel="noreferrer noopener"></a>。</p>



<p class="wp-block-paragraph">之后的操作就和 GitHub 完全一样了：</p>



<pre class="wp-block-code"><code># 克隆仓库
git clone http://你的服务器IP:3000/用户名/仓库名.git

# 进入项目
cd 仓库名

# 添加文件并提交
echo "# My Project" > README.md
git add .
git commit -m "first commit"

# 推送（使用用户名和 Token 认证）
git push origin main</code></pre>



<h2 class="wp-block-heading">团队协作与实用功能</h2>



<p class="wp-block-paragraph">Gitea 内置了完善的权限管理体系，通过&nbsp;<strong>组织（Organization）</strong>&nbsp;和&nbsp;<strong>团队（Team）</strong>&nbsp;来控制不同成员的访问级别。</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left">功能</th><th class="has-text-align-left" data-align="left">说明</th></tr></thead><tbody><tr><td>Pull Request</td><td>标准的代码评审流程，支持在线评论和代码修改</td></tr><tr><td>Issue 跟踪</td><td>支持标签、里程碑、指派、时间跟踪等功能</td></tr><tr><td>仓库镜像</td><td>自动同步 GitHub / GitLab 仓库，也可将 Gitea 仓库推送到外部<a href="https://juejin.cn/post/7295252900115955752" target="_blank" rel="noreferrer noopener"></a></td></tr><tr><td>Webhook</td><td>支持 Slack、钉钉等通知集成</td></tr><tr><td>迁移外部仓库</td><td>支持一键从 GitHub、GitLab、Gitee 等平台迁移</td></tr></tbody></table></figure>



<h2 class="wp-block-heading">总结</h2>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th class="has-text-align-left" data-align="left">场景</th><th class="has-text-align-left" data-align="left">推荐选择</th></tr></thead><tbody><tr><td>个人开发者 / 小团队（1-15 人）</td><td>Gitea 轻量、免费、易维护</td></tr><tr><td>服务器资源有限（1 核 2G）</td><td>Gitea 轻松运行</td></tr><tr><td>需要快速搭建私有代码仓库</td><td>Gitea，5 分钟搞定</td></tr><tr><td>大型企业 / 需要完整 DevOps 链路</td><td>GitLab 功能更全面<a href="https://blog.csdn.net/water/article/details/154281119" target="_blank" rel="noreferrer noopener"></a></td></tr></tbody></table></figure>



<p class="wp-block-paragraph">Gitea 的精髓在于：<strong>用最小的资源代价，提供最核心的代码托管能力</strong>。如果你正需要一个属于自己的 Git 服务平台，它绝对值得一试。</p>
<p>The post <a href="https://www.atomic-cube.cn/%e8%bd%bb%e9%87%8f%e7%ba%a7-git-%e7%a5%9e%e5%99%a8-gitea%ef%bc%9a%e4%bb%8e%e5%ae%89%e8%a3%85%e5%88%b0%e4%bd%bf%e7%94%a8%e4%b8%80%e7%af%87%e5%b0%b1%e5%a4%9f/">轻量级 Git 神器 Gitea：从安装到使用一篇就够</a> appeared first on <a href="https://www.atomic-cube.cn">原立方</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.atomic-cube.cn/%e8%bd%bb%e9%87%8f%e7%ba%a7-git-%e7%a5%9e%e5%99%a8-gitea%ef%bc%9a%e4%bb%8e%e5%ae%89%e8%a3%85%e5%88%b0%e4%bd%bf%e7%94%a8%e4%b8%80%e7%af%87%e5%b0%b1%e5%a4%9f/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>如何在Ubuntu上使用docker compose搭建gitlab服务器</title>
		<link>https://www.atomic-cube.cn/%e5%a6%82%e4%bd%95%e5%9c%a8ubuntu%e4%b8%8a%e4%bd%bf%e7%94%a8docker-compose%e6%90%ad%e5%bb%bagitlab%e6%9c%8d%e5%8a%a1%e5%99%a8/</link>
					<comments>https://www.atomic-cube.cn/%e5%a6%82%e4%bd%95%e5%9c%a8ubuntu%e4%b8%8a%e4%bd%bf%e7%94%a8docker-compose%e6%90%ad%e5%bb%bagitlab%e6%9c%8d%e5%8a%a1%e5%99%a8/#respond</comments>
		
		<dc:creator><![CDATA[evans]]></dc:creator>
		<pubDate>Mon, 13 Apr 2026 12:41:39 +0000</pubDate>
				<category><![CDATA[Docker]]></category>
		<category><![CDATA[gitea]]></category>
		<category><![CDATA[gitlab]]></category>
		<category><![CDATA[技术文章]]></category>
		<category><![CDATA[docker]]></category>
		<guid isPermaLink="false">https://www.atomic-cube.cn/%e5%a6%82%e4%bd%95%e5%9c%a8ubuntu%e4%b8%8a%e4%bd%bf%e7%94%a8docker-compose%e6%90%ad%e5%bb%bagitlab%e6%9c%8d%e5%8a%a1%e5%99%a8/</guid>

					<description><![CDATA[<p>1.docker安装 https://www.jianshu.com/p/ea9b201e8b59 2.使用d [&#8230;]</p>
<p>The post <a href="https://www.atomic-cube.cn/%e5%a6%82%e4%bd%95%e5%9c%a8ubuntu%e4%b8%8a%e4%bd%bf%e7%94%a8docker-compose%e6%90%ad%e5%bb%bagitlab%e6%9c%8d%e5%8a%a1%e5%99%a8/">如何在Ubuntu上使用docker compose搭建gitlab服务器</a> appeared first on <a href="https://www.atomic-cube.cn">原立方</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>1.docker安装</h3>
<pre><code>  https://www.jianshu.com/p/ea9b201e8b59
</code></pre>
<h3>2.使用docker-compose.yml搭建gitlab:</h3>
<pre><code>  -安装：https://docs.gitlab.com/ee/install/docker.html
</code></pre>
<h3>3.安装gitlab：</h3>
<p>https://docs.gitlab.com/ee/install/docker/installation.html</p>
<p>⚠️如果使用自定义端口请高仿：</p>
<pre><code>#yml文件格式检测网址https://www.bejson.com/validators/yaml_editor/
#gitlab-ce-compose.yml
version: '3.6'
services:
  web:
    container_name: gitlab
    image: 'gitlab/gitlab-ce:latest'
    restart: always
    hostname: 'gitlab.study.com'
    environment:
      GITLAB_OMNIBUS_CONFIG: |
       #记住这里一定要带上端口否则gitlab项目clone地址也会没有端口导致gitlab-runner拉取不到项目，这里特意提示下
        external_url 'http://192.168.1.6:1080'
        # Add any other gitlab.rb configuration here, each on its own line
        gitlab_rails['time_zone'] = 'Asia/Shanghai'
        gitlab_rails['smtp_enable'] = true
        gitlab_rails['gitlab_ssh_host'] = '192.168.1.6'
        gitlab_rails['gitlab_shell_ssh_port'] = 1022
    ports:
      - '1080:1080'
      - '1443:443'
      - '1022:22'
    volumes:
      - './config:/etc/gitlab'
      - './logs:/var/log/gitlab'
      - './data:/var/opt/gitlab'
    shm_size: '256m'
</code></pre>
<p>命令行执行：</p>
<pre><code>sudo docker-compose -f gitlab-ce-compose.yml up -d

#可能会报错：
ERROR: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
#解决方案(试了好多源都不行，终于)：
#https://blog.csdn.net/Crime_man/article/details/143468533
sudo vi /etc/docker/daemon.json
{
    "registry-mirrors":[
            https://docker.rainbond.cc/
            https://docker.rainbond.com/
    ]
}
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo systemctl docker info
sudo systemctl status docker
</code></pre>
<h3>5.修改root首次登陆密码：</h3>
<pre><code>    查看容器gitlab状态：
    docker ps
    进入gitlab的容器中：
    docker exec -it（gitlab的容器名称或id） bash
    启动Ruby on Rails控制台，稍微要多等待一会：
    gitlab-rails console
    等待控制台加载完毕并找到root用户：
    user = User.where(id: 1).first
    或者
    user = User.find_by(email: 'admin@example.com')
    更改密码
    user.password = '你的密码'
    user.password_confirmation = '确认你的密码'
    保存更改
    user.save!
    退出：
    exit
</code></pre>
<h3>4.成功：</h3>
<div class="image-package">
<div class="image-container" style="max-width: 700px; max-height: 373px;">
<div class="image-view" data-width="2864" data-height="1524"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-b76a444aa44dd3dc8abd0d3447ed0a75.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-b76a444aa44dd3dc8abd0d3447ed0a75.png" alt="" width="1200" height="639" /></a></div>
</div>
<div class="image-caption">image.png</div>
</div>
<h3>5.配置域名访问：</h3>
<div class="image-package">
<div class="image-container" style="max-width: 700px; max-height: 309px;">
<div class="image-view" data-width="2856" data-height="1260"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-2799c10c4244fb0dfb8c92b480f907d0.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-2799c10c4244fb0dfb8c92b480f907d0.png" alt="" width="1200" height="529" /></a></div>
</div>
<div class="image-caption"></div>
</div>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;End&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-</p>
<p>The post <a href="https://www.atomic-cube.cn/%e5%a6%82%e4%bd%95%e5%9c%a8ubuntu%e4%b8%8a%e4%bd%bf%e7%94%a8docker-compose%e6%90%ad%e5%bb%bagitlab%e6%9c%8d%e5%8a%a1%e5%99%a8/">如何在Ubuntu上使用docker compose搭建gitlab服务器</a> appeared first on <a href="https://www.atomic-cube.cn">原立方</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.atomic-cube.cn/%e5%a6%82%e4%bd%95%e5%9c%a8ubuntu%e4%b8%8a%e4%bd%bf%e7%94%a8docker-compose%e6%90%ad%e5%bb%bagitlab%e6%9c%8d%e5%8a%a1%e5%99%a8/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>【GitLab】使用Docker和Docker-Compose部署-个人、私有代码仓库</title>
		<link>https://www.atomic-cube.cn/%e3%80%90gitlab%e3%80%91%e4%bd%bf%e7%94%a8docker%e5%92%8cdocker-compose%e9%83%a8%e7%bd%b2-%e4%b8%aa%e4%ba%ba%e3%80%81%e7%a7%81%e6%9c%89%e4%bb%a3%e7%a0%81%e4%bb%93%e5%ba%93/</link>
					<comments>https://www.atomic-cube.cn/%e3%80%90gitlab%e3%80%91%e4%bd%bf%e7%94%a8docker%e5%92%8cdocker-compose%e9%83%a8%e7%bd%b2-%e4%b8%aa%e4%ba%ba%e3%80%81%e7%a7%81%e6%9c%89%e4%bb%a3%e7%a0%81%e4%bb%93%e5%ba%93/#respond</comments>
		
		<dc:creator><![CDATA[evans]]></dc:creator>
		<pubDate>Mon, 02 Mar 2026 12:41:00 +0000</pubDate>
				<category><![CDATA[Docker]]></category>
		<category><![CDATA[gitlab]]></category>
		<category><![CDATA[技术文章]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[gitea]]></category>
		<guid isPermaLink="false">https://www.atomic-cube.cn/%e3%80%90gitlab%e3%80%91%e4%bd%bf%e7%94%a8docker%e5%92%8cdocker-compose%e9%83%a8%e7%bd%b2-%e4%b8%aa%e4%ba%ba%e3%80%81%e7%a7%81%e6%9c%89%e4%bb%a3%e7%a0%81%e4%bb%93%e5%ba%93/</guid>

					<description><![CDATA[<p>概述 GitLab 是一个用于仓库管理系统的开源项目，使用Git作为代码管理工具，并在此基础上搭建起来的Web [&#8230;]</p>
<p>The post <a href="https://www.atomic-cube.cn/%e3%80%90gitlab%e3%80%91%e4%bd%bf%e7%94%a8docker%e5%92%8cdocker-compose%e9%83%a8%e7%bd%b2-%e4%b8%aa%e4%ba%ba%e3%80%81%e7%a7%81%e6%9c%89%e4%bb%a3%e7%a0%81%e4%bb%93%e5%ba%93/">【GitLab】使用Docker和Docker-Compose部署-个人、私有代码仓库</a> appeared first on <a href="https://www.atomic-cube.cn">原立方</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>概述</h1>
<p>GitLab 是一个用于仓库管理系统的开源项目，使用Git作为代码管理工具，并在此基础上搭建起来的Web服务。<br />
GitLab和GitHub一样是仓库管理系统，不一样的是GitLab可以自己搭建，自己或企业内部使用。</p>
<h1>环境准备</h1>
<ul>
<li>Linux系统</li>
<li>docker</li>
<li>docker-compose</li>
</ul>
<h1>硬件要求</h1>
<p><strong>CPU</strong></p>
<ul>
<li><strong>4 核</strong>是<strong>推荐</strong>的最小核数，最多支持 500 个用户</li>
<li>8核最多支持1000个用户</li>
</ul>
<p><strong>RAM</strong></p>
<ul>
<li>4GB RAM是所需的最小内存大小，最多可支持 500 个用户</li>
<li>8GB RAM 支持多达 1000 个用户</li>
</ul>
<h1>安装</h1>
<p>GitLab Docker 镜像可以以多种方式运行：这里介绍前面2种</p>
<ul>
<li>使用 Docker 引擎</li>
<li>使用 Docker-compose</li>
<li>使用 Docker swarm集群模式</li>
</ul>
<h2>1.docker引擎安装gitlab</h2>
<ul>
<li>拉取镜像，目前2022年5月，gitlab/gitlab-ce最新版docker镜像2.36GB（有点大可以提前下载）<br />
[图片上传失败&#8230;(image-db2b80-1651758787556)]</li>
<li>下载并启动 GitLab 容器，并发布访问 SSH、HTTP 和 HTTPS 所需的端口。所有 GitLab 数据都将存储为 /mydata/</li>
</ul>
<pre><code class="bash">docker run --detach 
  --hostname gitlab.admin.com 
  --publish 1443:443 --publish 81:80 --publish 1022:22 
  --name gitlab 
  --restart always 
  --volume /mydata/config:/etc/gitlab 
  --volume /mydata/logs:/var/log/gitlab 
  --volume /mydata/data:/var/opt/gitlab 
  gitlab/gitlab-ce:latest
</code></pre>
<table>
<thead>
<tr>
<th style="text-align: left;">本地位置</th>
<th style="text-align: left;">容器位置</th>
<th style="text-align: left;">用法</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;"><code>/mydata/data</code></td>
<td style="text-align: left;"><code>/var/opt/gitlab</code></td>
<td style="text-align: left;">用于存储应用程序数据</td>
</tr>
<tr>
<td style="text-align: left;"><code>/mydata/logs</code></td>
<td style="text-align: left;"><code>/var/log/gitlab</code></td>
<td style="text-align: left;">用于存储日志</td>
</tr>
<tr>
<td style="text-align: left;"><code>/mydata/config</code></td>
<td style="text-align: left;"><code>/etc/gitlab</code></td>
<td style="text-align: left;">用于存储 GitLab 配置文件</td>
</tr>
</tbody>
</table>
<ul>
<li>GitLab初始化启动过程需要很长时间，您可以通过logs方式跟踪此过程：</li>
</ul>
<pre><code class="bash">docker logs -ft gitlab
</code></pre>
<ul>
<li>启动容器后，浏览器访问gitlab.admin.com:81，这里如果域名没做hosts映射的话，请使用ip地址：<code>192.168.200.11:81</code>。
<div class="image-package">
<div class="image-container" style="max-width: 700px; max-height: 655px;">
<div class="image-view" data-width="1215" data-height="655"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-6a0eeee00fcd6273c5381716cb521dc0.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-6a0eeee00fcd6273c5381716cb521dc0.png" alt="" width="1215" height="655" /></a></div>
</div>
<div class="image-caption">image.png</div>
</div>
</li>
<li>这里GitLab 默认创建root用户和密码，<code>root用户 密码查询</code>：</li>
</ul>
<pre><code class="bash">docker exec -it gitlab grep 'Password:' /etc/gitlab/initial_root_password
</code></pre>
<ul>
<li>输入root用户（管理员）和密码登录：
<div class="image-package">
<div class="image-container" style="max-width: 700px; max-height: 620px;">
<div class="image-view" data-width="1259" data-height="620"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-c949a878957cd8c74dfec97ee3b5684c.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-c949a878957cd8c74dfec97ee3b5684c.png" alt="" width="1259" height="620" /></a></div>
</div>
<div class="image-caption">image.png</div>
</div>
</li>
</ul>
<div class="image-package">
<div class="image-container" style="max-width: 700px; max-height: 585px;">
<div class="image-view" data-width="1259" data-height="585"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-428c586b527f63ae42274609ebdc848a.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-428c586b527f63ae42274609ebdc848a.png" alt="" width="1259" height="585" /></a></div>
</div>
<div class="image-caption">image.png</div>
</div>
<h2>2.使用 Docker Compose 安装 GitLab&#8212;*<em>(compose案例看这里！！)</em></h2>
<p>使用Docker Compose，您可以轻松配置、安装和升级 GitLab ：</p>
<ol>
<li>安装 Docker Compose</li>
<li>创建<code>docker-compose.yml</code>文件</li>
</ol>
<pre><code class="bash">version: '3.6'
services:
  web:
    image: 'gitlab/gitlab-ce:latest'
    restart: always
    hostname: 'gitlab.admin.com'
    ports:
      - '82:80'
      - '10443:443'
      - '11022:22'
    volumes:
      - '/mydata-2/config:/etc/gitlab'
      - '/mydata-2/logs:/var/log/gitlab'
      - '/mydata-2/data:/var/opt/gitlab'
</code></pre>
<ol start="3">
<li>确保您<code>docker-compose.yml</code>与启动 GitLab 位于同一目录中：</li>
</ol>
<ul>
<li>后台启动compose</li>
</ul>
<pre><code class="bash">docker-compose up -d
</code></pre>
<ul>
<li>查看状态</li>
</ul>
<pre><code class="bash">[root@master cicd]# docker-compose ps
   Name          Command          State                                     Ports
---------------------------------------------------------------------------------------------------------------
cicd_web_1   /assets/wrapper   Up (healthy)   0.0.0.0:11022-&gt;22/tcp, 0.0.0.0:10443-&gt;443/tcp, 0.0.0.0:82-&gt;80/tcp

</code></pre>
<ul>
<li>浏览器访问登录
<div class="image-package">
<div class="image-container" style="max-width: 700px; max-height: 638px;">
<div class="image-view" data-width="1237" data-height="638"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-da886b68609f9c2eec2d976069144bd1.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-da886b68609f9c2eec2d976069144bd1.png" alt="" width="1237" height="638" /></a></div>
</div>
</div>
</li>
</ul>
<p>The post <a href="https://www.atomic-cube.cn/%e3%80%90gitlab%e3%80%91%e4%bd%bf%e7%94%a8docker%e5%92%8cdocker-compose%e9%83%a8%e7%bd%b2-%e4%b8%aa%e4%ba%ba%e3%80%81%e7%a7%81%e6%9c%89%e4%bb%a3%e7%a0%81%e4%bb%93%e5%ba%93/">【GitLab】使用Docker和Docker-Compose部署-个人、私有代码仓库</a> appeared first on <a href="https://www.atomic-cube.cn">原立方</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.atomic-cube.cn/%e3%80%90gitlab%e3%80%91%e4%bd%bf%e7%94%a8docker%e5%92%8cdocker-compose%e9%83%a8%e7%bd%b2-%e4%b8%aa%e4%ba%ba%e3%80%81%e7%a7%81%e6%9c%89%e4%bb%a3%e7%a0%81%e4%bb%93%e5%ba%93/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
