<?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>docker Archives - 原立方</title>
	<atom:link href="https://www.atomic-cube.cn/tag/docker/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.atomic-cube.cn/tag/docker/</link>
	<description>技术栈的流动-从零到∞</description>
	<lastBuildDate>Sun, 10 May 2026 13:14:05 +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>本地安装Minikube部署Kubernetes环境</title>
		<link>https://www.atomic-cube.cn/apple-chip%e5%ae%89%e8%a3%85minikube/</link>
					<comments>https://www.atomic-cube.cn/apple-chip%e5%ae%89%e8%a3%85minikube/#respond</comments>
		
		<dc:creator><![CDATA[evans]]></dc:creator>
		<pubDate>Wed, 29 Apr 2026 23:20:00 +0000</pubDate>
				<category><![CDATA[Docker]]></category>
		<category><![CDATA[K8S]]></category>
		<category><![CDATA[Kubernetes]]></category>
		<category><![CDATA[技术文章]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[k3s]]></category>
		<category><![CDATA[k8s]]></category>
		<category><![CDATA[Minikube]]></category>
		<guid isPermaLink="false">https://www.atomic-cube.cn/?p=1685</guid>

					<description><![CDATA[<p>Minikube&#160;是一个工具，它为本地环境提供了一种轻量化的&#160;Kubernetes&#038;nbs [&#8230;]</p>
<p>The post <a href="https://www.atomic-cube.cn/apple-chip%e5%ae%89%e8%a3%85minikube/">本地安装Minikube部署Kubernetes环境</a> appeared first on <a href="https://www.atomic-cube.cn">原立方</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Minikube&nbsp;是一个工具，它为本地环境提供了一种轻量化的&nbsp;Kubernetes&nbsp;集群实现。通过 Minikube，用户可以在本地机器上快速启动并运行一个 Kubernetes 环境，用来学习、测试和开发。Minikube支持Kubernetes的所有主要功能，包括Dashboard、DNS、容器运行时（如Docker、containerd、CRI-O）等。这种本地化的 Kubernetes 环境主要为开发者提供了便捷，不再需要花费额外的精力去搭建和维护一个庞大的远程集群。</p>



<h4 class="wp-block-heading" id="mR92-1776855755612"><strong>1.安装 Docker Desktop</strong></h4>



<p class="wp-block-paragraph">作为官方推荐的容器化平台，安装Docker Desktop能让你顺利使用Docker驱动<a href="https://developer.baidu.com/article/detail.html?id=3189546"></a>。</p>



<ul class="wp-block-list">
<li><strong>下载与安装</strong>：访问&nbsp;<a href="https://www.docker.com/products/docker-desktop/">Docker 官网</a>，我使用的是Mac M2，需要下载适用于&nbsp;<strong>Apple Chip</strong>&nbsp;的安装包并进行安装<a href="https://blog.csdn.net/hiliang521/article/details/158770295"></a><a href="https://www.e-com-net.com/article/1739862094263631872.htm"></a>。</li>



<li><strong>启动与验证</strong>：安装完成后，启动 Docker Desktop，并确保它在后台正常运行，状态显示为&nbsp;Running<a href="https://blog.csdn.net/hiliang521/article/details/158770295"></a>。</li>
</ul>



<p class="wp-block-paragraph"><strong>2. 安装 Minikube 和 kubectl</strong></p>



<p class="wp-block-paragraph">使用 Homebrew 可以一键安装这两个核心工具<a href="https://blog.csdn.net/hiliang521/article/details/158770295"></a><a href="https://developer.baidu.com/article/detail.html?id=3189546"></a>。</p>



<p class="wp-block-paragraph"><strong>使用 Homebrew 安装</strong>：在终端中执行以下命令：</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>brew install kubectl
brew install minikube</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9">brew</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">install</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">kubectl</span></span>
<span class="line"><span style="color: #D8DEE9">brew</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">install</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">minikube</span></span></code></pre></div>



<p class="wp-block-paragraph"><br><strong>验证安装</strong>：运行以下命令，确认版本信息能正常输出：</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>kubectl version --client
minikube version</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9">kubectl</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">version</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--</span><span style="color: #D8DEE9">client</span></span>
<span class="line"><span style="color: #D8DEE9">minikube</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">version</span></span></code></pre></div>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="860" height="216" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/image.png" alt="" class="wp-image-1686" srcset="https://www.atomic-cube.cn/wp-content/uploads/2026/04/image.png 860w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-300x75.png 300w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-768x193.png 768w" sizes="(max-width: 860px) 100vw, 860px" /></figure>



<p class="wp-block-paragraph"><strong>3. 启动你的 Kubernetes 集群</strong></p>



<p class="wp-block-paragraph">启动命令是最关键的一步。对于国内的网络环境，强烈建议配置阿里云的镜像加速，这能显著提升启动速度和成功率。</p>



<p class="wp-block-paragraph"><strong>推荐方案：使用 Docker 驱动 + 阿里云镜像/dl.k8s.io加速</strong>：使用以下命令启动 Minikube：</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>docker配置使用国内镜像源后，可直接运行：
minikube start --driver=docker

可以手动指定其他源，可尝试多次下载：
minikube start --driver=docker --kubernetes-version='v1.35.1' --binary-mirror='https://dl.k8s.io'

如出现下载失败或者下载超时，可采用以下方式彻底清除现有集群和缓存，然后重新执行上面的命令进行下载：
minikube delete --all --purge
rm -rf ~/.minikube   # 可选，彻底清理残留配置</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9">docker配置使用国内镜像源后</span><span style="color: #D8DEE9FF">，</span><span style="color: #D8DEE9">可直接运行</span><span style="color: #D8DEE9FF">：</span></span>
<span class="line"><span style="color: #D8DEE9">minikube</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">start</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--</span><span style="color: #D8DEE9">driver</span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9">docker</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9">可以手动指定其他源</span><span style="color: #D8DEE9FF">，</span><span style="color: #D8DEE9">可尝试多次下载</span><span style="color: #D8DEE9FF">：</span></span>
<span class="line"><span style="color: #D8DEE9">minikube</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">start</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--</span><span style="color: #D8DEE9">driver</span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9">docker</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--</span><span style="color: #D8DEE9">kubernetes</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">version</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">v1.35.1</span><span style="color: #ECEFF4">&#39;</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--</span><span style="color: #D8DEE9">binary</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">mirror</span><span style="color: #81A1C1">=</span><span style="color: #ECEFF4">&#39;</span><span style="color: #A3BE8C">https://dl.k8s.io</span><span style="color: #ECEFF4">&#39;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9">如出现下载失败或者下载超时</span><span style="color: #D8DEE9FF">，</span><span style="color: #D8DEE9">可采用以下方式彻底清除现有集群和缓存</span><span style="color: #D8DEE9FF">，</span><span style="color: #D8DEE9">然后重新执行上面的命令进行下载</span><span style="color: #D8DEE9FF">：</span></span>
<span class="line"><span style="color: #D8DEE9">minikube</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">delete</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--</span><span style="color: #D8DEE9">all</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--</span><span style="color: #D8DEE9">purge</span></span>
<span class="line"><span style="color: #D8DEE9">rm</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">rf</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">~/</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">minikube</span><span style="color: #D8DEE9FF">   # </span><span style="color: #D8DEE9">可选</span><span style="color: #D8DEE9FF">，</span><span style="color: #D8DEE9">彻底清理残留配置</span></span></code></pre></div>



<p class="wp-block-paragraph"><strong>4.验证并开始使用</strong></p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>minikube status
kubectl get nodes</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9">minikube</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">status</span></span>
<span class="line"><span style="color: #D8DEE9">kubectl</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">get</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">nodes</span></span></code></pre></div>



<p class="wp-block-paragraph">如果看到节点状态为&nbsp;Ready，就说明你的单节点 Kubernetes 集群已经成功运行了<a href="https://blog.csdn.net/hiliang521/article/details/158770295"></a>。</p>



<figure class="wp-block-image size-full"><img decoding="async" width="984" height="384" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-1.png" alt="" class="wp-image-1690" srcset="https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-1.png 984w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-1-300x117.png 300w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-1-768x300.png 768w" sizes="(max-width: 984px) 100vw, 984px" /></figure>



<p class="wp-block-paragraph"><strong>5. (可选) 启用 Minikube 插件</strong></p>



<p class="wp-block-paragraph">Minikube 提供了许多插件来扩展功能，最常用的是仪表盘（Dashboard）。</p>



<p class="wp-block-paragraph"><strong>启用仪表盘 (Dashboard)</strong>：执行以下命令，浏览器将自动打开 Kubernetes 的 Web UI 界面，方便你直观地管理集群。</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>minikube addons enable dashboard
启用可能会失败：
# 拉取 dashboard 镜像
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/dashboard:v2.7.0

# 拉取 metrics-scraper 镜像
docker pull registry.cn-hangzhou.aliyuncs.com/google_containers/metrics-scraper:v1.0.8

将拉取下来的国内镜像，标记为 Kubernetes 期望的官方镜像名：
docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/dashboard:v2.7.0 kubernetes/dashboard:v2.7.0

docker tag registry.cn-hangzhou.aliyuncs.com/google_containers/metrics-scraper:v1.0.8 kubernetes/metrics-scraper:v1.0.8

删除失败的 Pod，让它们重新创建
kubectl delete pod -n kubernetes-dashboard --all

kubectl get pods -n kubernetes-dashboard

minikube dashboard</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9">minikube</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">addons</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">enable</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">dashboard</span></span>
<span class="line"><span style="color: #D8DEE9">启用可能会失败</span><span style="color: #D8DEE9FF">：</span></span>
<span class="line"><span style="color: #D8DEE9FF"># </span><span style="color: #D8DEE9">拉取</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">dashboard</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">镜像</span></span>
<span class="line"><span style="color: #D8DEE9">docker</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">pull</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">registry</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">cn</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">hangzhou</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">aliyuncs</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">com</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9">google_containers</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">dashboard</span><span style="color: #ECEFF4">:</span><span style="color: #D8DEE9">v2</span><span style="color: #ECEFF4">.</span><span style="color: #B48EAD">7.0</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9FF"># </span><span style="color: #D8DEE9">拉取</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">metrics</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">scraper</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">镜像</span></span>
<span class="line"><span style="color: #D8DEE9">docker</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">pull</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">registry</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">cn</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">hangzhou</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">aliyuncs</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">com</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9">google_containers</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9">metrics</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">scraper</span><span style="color: #ECEFF4">:</span><span style="color: #D8DEE9">v1</span><span style="color: #ECEFF4">.</span><span style="color: #B48EAD">0.8</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9">将拉取下来的国内镜像</span><span style="color: #D8DEE9FF">，</span><span style="color: #D8DEE9">标记为</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">Kubernetes</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">期望的官方镜像名</span><span style="color: #D8DEE9FF">：</span></span>
<span class="line"><span style="color: #D8DEE9">docker</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">tag</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">registry</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">cn</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">hangzhou</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">aliyuncs</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">com</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9">google_containers</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">dashboard</span><span style="color: #ECEFF4">:</span><span style="color: #D8DEE9">v2</span><span style="color: #ECEFF4">.</span><span style="color: #B48EAD">7.0</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">kubernetes</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9FF">dashboard</span><span style="color: #ECEFF4">:</span><span style="color: #D8DEE9">v2</span><span style="color: #ECEFF4">.</span><span style="color: #B48EAD">7.0</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9">docker</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">tag</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">registry</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">cn</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">hangzhou</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">aliyuncs</span><span style="color: #ECEFF4">.</span><span style="color: #D8DEE9">com</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9">google_containers</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9">metrics</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">scraper</span><span style="color: #ECEFF4">:</span><span style="color: #D8DEE9">v1</span><span style="color: #ECEFF4">.</span><span style="color: #B48EAD">0.8</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">kubernetes</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9">metrics</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9FF">scraper</span><span style="color: #ECEFF4">:</span><span style="color: #D8DEE9">v1</span><span style="color: #ECEFF4">.</span><span style="color: #B48EAD">0.8</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9">删除失败的</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">Pod</span><span style="color: #D8DEE9FF">，</span><span style="color: #D8DEE9">让它们重新创建</span></span>
<span class="line"><span style="color: #D8DEE9">kubectl</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">delete</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">pod</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">n</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">kubernetes</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">dashboard</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--</span><span style="color: #D8DEE9">all</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9">kubectl</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">get</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">pods</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">n</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">kubernetes</span><span style="color: #81A1C1">-</span><span style="color: #D8DEE9">dashboard</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9">minikube</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">dashboard</span></span></code></pre></div>



<figure class="wp-block-image size-large"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-2-scaled.png"><img decoding="async" width="1024" height="529" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-2-1024x529.png" alt="" class="wp-image-1720" srcset="https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-2-1024x529.png 1024w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-2-300x155.png 300w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-2-768x397.png 768w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-2-1536x794.png 1536w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-2-2048x1058.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<figure class="wp-block-image size-large"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-13-scaled.png"><img decoding="async" width="1024" height="525" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-13-1024x525.png" alt="" class="wp-image-1751" srcset="https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-13-1024x525.png 1024w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-13-300x154.png 300w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-13-768x393.png 768w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-13-1536x787.png 1536w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-13-2048x1049.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<figure class="wp-block-image size-large"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-14-scaled.png"><img decoding="async" width="1024" height="512" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-14-1024x512.png" alt="" class="wp-image-1753" srcset="https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-14-1024x512.png 1024w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-14-300x150.png 300w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-14-768x384.png 768w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-14-1536x768.png 1536w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-14-2048x1024.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<figure class="wp-block-image size-large"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-15-scaled.png"><img decoding="async" width="1024" height="523" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-15-1024x523.png" alt="" class="wp-image-1754" srcset="https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-15-1024x523.png 1024w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-15-300x153.png 300w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-15-768x392.png 768w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-15-1536x785.png 1536w, https://www.atomic-cube.cn/wp-content/uploads/2026/04/image-15-2048x1046.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<p class="wp-block-paragraph"><br><strong>更多插件</strong>：执行&nbsp;minikube addons list&nbsp;可以查看所有可用插件，例如&nbsp;ingress&nbsp;用于管理入站网络流量。</p>



<p class="wp-block-paragraph"><strong>🧪 测试集群：部署一个 Nginx 应用</strong></p>



<p class="wp-block-paragraph">为了验证集群功能，可以尝试部署一个简单的 Nginx 应用<a href="https://blog.csdn.net/xuezhiwu001/article/details/128392695"></a>。</p>



<ol class="wp-block-list">
<li><strong>创建 Nginx Deployment</strong>：</li>
</ol>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>kubectl create deployment nginx --image=nginx:alpine</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9">kubectl</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">create</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">deployment</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">nginx</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--</span><span style="color: #D8DEE9">image</span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9FF">nginx</span><span style="color: #ECEFF4">:</span><span style="color: #D8DEE9">alpine</span></span></code></pre></div>



<p class="wp-block-paragraph">2.<strong>创建一个 Service 来暴露应用</strong>：</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>kubectl expose deployment nginx --type=NodePort --port=80</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9">kubectl</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">expose</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">deployment</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">nginx</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--</span><span style="color: #D8DEE9">type</span><span style="color: #81A1C1">=</span><span style="color: #D8DEE9">NodePort</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--</span><span style="color: #D8DEE9">port</span><span style="color: #81A1C1">=</span><span style="color: #B48EAD">80</span></span></code></pre></div>



<p class="wp-block-paragraph">3.<strong>获取访问地址</strong>：运行以下命令获取服务的访问 URL，然后在浏览器中打开它，就能看到 Nginx 的欢迎页面了。</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>minikube service nginx --url</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9">minikube</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">service</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">nginx</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">--</span><span style="color: #D8DEE9">url</span></span></code></pre></div>



<p class="wp-block-paragraph">4.<strong>清理测试资源</strong>：测试完成后，可以删除 Deployment 和 Service 来释放资源。</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#d8dee9ff;--cbp-line-number-width:calc(1 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" style="color:#d8dee9ff;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>kubectl delete service nginx
kubectl delete deployment nginx

常用 Minikube 命令
停止集群: minikube stop (保留数据，释放 CPU/内存)
暂停集群: minikube pause (快速暂停)
删除集群: minikube delete (彻底删除数据)
查看 Dashboard: minikube dashboard (打开 Web 界面)
查看插件列表: minikube addons list</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki nord" style="background-color: #2e3440ff" tabindex="0"><code><span class="line"><span style="color: #D8DEE9">kubectl</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">delete</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">service</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">nginx</span></span>
<span class="line"><span style="color: #D8DEE9">kubectl</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">delete</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">deployment</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">nginx</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D8DEE9">常用</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">Minikube</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">命令</span></span>
<span class="line"><span style="color: #D8DEE9FF">停止集群</span><span style="color: #ECEFF4">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">minikube</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">stop</span><span style="color: #D8DEE9FF"> (</span><span style="color: #D8DEE9">保留数据</span><span style="color: #D8DEE9FF">，</span><span style="color: #D8DEE9">释放</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">CPU</span><span style="color: #81A1C1">/</span><span style="color: #D8DEE9">内存</span><span style="color: #D8DEE9FF">)</span></span>
<span class="line"><span style="color: #D8DEE9FF">暂停集群</span><span style="color: #ECEFF4">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">minikube</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">pause</span><span style="color: #D8DEE9FF"> (</span><span style="color: #D8DEE9">快速暂停</span><span style="color: #D8DEE9FF">)</span></span>
<span class="line"><span style="color: #D8DEE9FF">删除集群</span><span style="color: #ECEFF4">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">minikube</span><span style="color: #D8DEE9FF"> </span><span style="color: #81A1C1">delete</span><span style="color: #D8DEE9FF"> (</span><span style="color: #D8DEE9">彻底删除数据</span><span style="color: #D8DEE9FF">)</span></span>
<span class="line"><span style="color: #D8DEE9">查看</span><span style="color: #D8DEE9FF"> Dashboard</span><span style="color: #ECEFF4">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">minikube</span><span style="color: #D8DEE9FF"> </span><span style="color: #88C0D0">dashboard</span><span style="color: #D8DEE9FF"> (</span><span style="color: #D8DEE9">打开</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">Web</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">界面</span><span style="color: #D8DEE9FF">)</span></span>
<span class="line"><span style="color: #D8DEE9FF">查看插件列表</span><span style="color: #ECEFF4">:</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">minikube</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">addons</span><span style="color: #D8DEE9FF"> </span><span style="color: #D8DEE9">list</span></span></code></pre></div>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.atomic-cube.cn/apple-chip%e5%ae%89%e8%a3%85minikube/">本地安装Minikube部署Kubernetes环境</a> appeared first on <a href="https://www.atomic-cube.cn">原立方</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.atomic-cube.cn/apple-chip%e5%ae%89%e8%a3%85minikube/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<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 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>基于docker搭建aiclient2api图文教程</title>
		<link>https://www.atomic-cube.cn/%e5%9f%ba%e4%ba%8edocker%e6%90%ad%e5%bb%baaiclient2api%e5%9b%be%e6%96%87%e6%95%99%e7%a8%8b/</link>
					<comments>https://www.atomic-cube.cn/%e5%9f%ba%e4%ba%8edocker%e6%90%ad%e5%bb%baaiclient2api%e5%9b%be%e6%96%87%e6%95%99%e7%a8%8b/#respond</comments>
		
		<dc:creator><![CDATA[evans]]></dc:creator>
		<pubDate>Sun, 22 Mar 2026 08:26:06 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[claude code]]></category>
		<category><![CDATA[Codex]]></category>
		<category><![CDATA[Docker]]></category>
		<category><![CDATA[LLM]]></category>
		<category><![CDATA[Vibe Coding]]></category>
		<category><![CDATA[技术文章]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[llm]]></category>
		<category><![CDATA[token]]></category>
		<guid isPermaLink="false">https://www.atomic-cube.cn/?p=925</guid>

					<description><![CDATA[<p>1. 前言 本文基于aiclient2api v2.9.7版本，Github地址为 https://githu [&#8230;]</p>
<p>The post <a href="https://www.atomic-cube.cn/%e5%9f%ba%e4%ba%8edocker%e6%90%ad%e5%bb%baaiclient2api%e5%9b%be%e6%96%87%e6%95%99%e7%a8%8b/">基于docker搭建aiclient2api图文教程</a> appeared first on <a href="https://www.atomic-cube.cn">原立方</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2 id="1.-%E5%89%8D%E8%A8%80">1. 前言</h2>
<p>本文基于aiclient2api v2.9.7版本，Github地址为 <a href="https://github.com/justlovemaki/AIClient-2-API" target="_blank" rel="noopener">https://github.com/justlovemaki/AIClient-2-API</a></p>
<p>aiclient2api 能够将 GeminiCLI ， ClaudeCode 等转换为不仅限于原客户端使用的API，从而供给OpenClaw或其它客户端使用</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"></figure>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"></figure>
<h2 id="2.-%E6%90%AD%E5%BB%BA">2. 搭建</h2>
<p>首先选择一个目录，本文中使用的是<code>/data/aiclient2api</code></p>
<p>运行 <code>mkdir -p /data/aiclient2api &amp;&amp; touch /data/aiclient2api/compose.yaml</code> ，创建docker compose文件</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><img decoding="async" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-e8bb4efdfa9e7a95d500062a492f08c1.png" /></figure>
<p>复制以下docker compose 配置（3000端口比较常见容易被占用所以这里我改成了3180，可自行修改为其它端口）<br /><span style="background-color: #ffffff; color: #1f2328; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; font-size: 16px;">3000 为 Web UI，其余为 OAuth 回调端口（Gemini: 8085, Antigravity: 8086, iFlow: 8087, Codex: 1455, Kiro: 19876-19880）</span></p>
<pre><code class="language-yaml">services:
  aiclient-api:
    image: justlikemaki/aiclient-2-api:latest
    container_name: aiclient2api
    restart: unless-stopped
    ports:
      - "3180:3000"
      - "8085-8087:8085-8087" 
      - "1455:1455"
      - "19876-19880:19876-19880"
    volumes:
      - ./configs:/app/configs
    environment:
      - ARGS=
    healthcheck:
      test: ["CMD", "node", "healthcheck.js"]
      interval: 30s
      timeout: 3s
      start_period: 5s
      retries: 3</code></pre>
<p>粘贴到刚刚新建的 compose.yaml 里</p>
<figure style="align-items: center; display: flex; flex-direction: column;" data-content-type="image"><img decoding="async" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-c0d62db8c40fa0c53015cd1c12df5350.png" /></figure>
<p>运行如下命令 <code>cd /data/aiclient2api &amp;&amp; docker compose up -d</code> ，创建容器，如图即为成功</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><img decoding="async" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-0351818dcd71dc2dc3409a4b2ba67ba5.png" /></figure>
<h2 id="3.-%E9%85%8D%E7%BD%AE">3. 配置</h2>
<p>访问 服务器IP:3180 （如果你修改了端口则替换为你的端口），初始密码为 <code>admin123</code> ，点击登录</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-6265c7c4baeb22a020702aeafc9bc340.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-6265c7c4baeb22a020702aeafc9bc340.png" alt="" width="1920" height="927" /></a></figure>
<p>进入管理控制台</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-211b8f221b8270eacfeb7766c877db7d.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-211b8f221b8270eacfeb7766c877db7d.png" alt="" width="1920" height="927" /></a></figure>
<p>首先要修改登录密码，点击 配置管理 ，滑动到最下面，修改后台登录密码，点击保存配置</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-59fd411072af3e1088d4727d18d44429.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-59fd411072af3e1088d4727d18d44429.png" alt="" width="1920" height="927" /></a></figure>
<p>本文以对接Gemini CLI作为教程，其它大同小异，请自行研究</p>
<p>（如果以前没用过Gemini CLI，可能会遇到需要开启谷歌云或验证手机号等情况，建议先本地安装一个Gemini CLI登录过排完坑了再来接入）</p>
<p>点击提供商池管理，点击生成授权</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-3a0e146e4ea8a4d441f95ae0e247bbe8.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-3a0e146e4ea8a4d441f95ae0e247bbe8.png" alt="" width="1912" height="929" /></a></figure>
<p>选择 OAuth 授权</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-5750cea8d82abf689911751dcb1038a1.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-5750cea8d82abf689911751dcb1038a1.png" alt="" width="1912" height="927" /></a></figure>
<p>复制链接在浏览器中打开，或直接点击 在浏览器中打开 按钮</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-4c55064f7c29ed9db41f623d67f6c36e.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-4c55064f7c29ed9db41f623d67f6c36e.png" alt="" width="1912" height="927" /></a></figure>
<p>根据提示登录 Google 账户</p>
<figure style="align-items: center; display: flex; flex-direction: column;" data-content-type="image"><img decoding="async" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-76eb6f595f92eddc5e2c68735b12bfb8.png" /></figure>
<p>此时会显示如下，不要慌张，将此处的 localhost 修改为你的服务器IP，再次访问即可</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><img decoding="async" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-8fc113091f94eccf14628d5e581878f0.png" /></figure>
<p>如下，授权成功</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><img decoding="async" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-9812c3e6041baa46bb93aa8ce9a3a7ed.png" /></figure>
<p>回到aiclient2api可以看到已经成功了</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-84480083fd4845575efd6f2336bd5004.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-84480083fd4845575efd6f2336bd5004.png" alt="" width="1920" height="927" /></a></figure>
<p>接下来点击配置管理，将API密钥随意修改为你想要的，下面的模型提供商把你对接了的都选上（本文只对接了一个 Gemini CLI 所以暂时只选这一个）</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-66e6c6acf8d13ec6077e368e7540e2f4.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-66e6c6acf8d13ec6077e368e7540e2f4.png" alt="" width="1920" height="927" /></a></figure>
<p>下拉到此处，启用OAuth令牌自动刷新</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-d641ae3d843bb3c0c90268687d29866d.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-d641ae3d843bb3c0c90268687d29866d.png" alt="" width="1920" height="927" /></a></figure>
<p>下拉到最下方，保存配置</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-1973199973311bc1dedccb492368300b.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-1973199973311bc1dedccb492368300b.png" alt="" width="1920" height="927" /></a></figure>
<h2 id="4.-%E4%BD%BF%E7%94%A8">4. 使用</h2>
<p>到此已经完成，可以使用该密钥了，BaseURL 即为你的服务器IP:项目端口，本项目能提供标准的OpenAI API和Claude API，这里就不过多赘述了</p>


<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.atomic-cube.cn/%e5%9f%ba%e4%ba%8edocker%e6%90%ad%e5%bb%baaiclient2api%e5%9b%be%e6%96%87%e6%95%99%e7%a8%8b/">基于docker搭建aiclient2api图文教程</a> appeared first on <a href="https://www.atomic-cube.cn">原立方</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.atomic-cube.cn/%e5%9f%ba%e4%ba%8edocker%e6%90%ad%e5%bb%baaiclient2api%e5%9b%be%e6%96%87%e6%95%99%e7%a8%8b/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>基于docker搭建sub2api图文教程</title>
		<link>https://www.atomic-cube.cn/%e5%9f%ba%e4%ba%8edocker%e6%90%ad%e5%bb%basub2api%e5%9b%be%e6%96%87%e6%95%99%e7%a8%8b/</link>
					<comments>https://www.atomic-cube.cn/%e5%9f%ba%e4%ba%8edocker%e6%90%ad%e5%bb%basub2api%e5%9b%be%e6%96%87%e6%95%99%e7%a8%8b/#respond</comments>
		
		<dc:creator><![CDATA[evans]]></dc:creator>
		<pubDate>Wed, 11 Mar 2026 08:25:34 +0000</pubDate>
				<category><![CDATA[Docker]]></category>
		<category><![CDATA[LLM]]></category>
		<category><![CDATA[技术文章]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[llm]]></category>
		<category><![CDATA[token]]></category>
		<guid isPermaLink="false">https://www.atomic-cube.cn/?p=861</guid>

					<description><![CDATA[<p>1. 前言 本文基于sub2api v0.1.84版本，Github地址为 https://github.co [&#8230;]</p>
<p>The post <a href="https://www.atomic-cube.cn/%e5%9f%ba%e4%ba%8edocker%e6%90%ad%e5%bb%basub2api%e5%9b%be%e6%96%87%e6%95%99%e7%a8%8b/">基于docker搭建sub2api图文教程</a> appeared first on <a href="https://www.atomic-cube.cn">原立方</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2 id="1.-%E5%89%8D%E8%A8%80">1. 前言</h2>
<p>本文基于sub2api v0.1.84版本，Github地址为 <a href="https://github.com/Wei-Shaw/sub2api" target="_blank" rel="noopener">https://github.com/Wei-Shaw/sub2api</a></p>
<p>sub2api 能够将 GeminiCLI ， ClaudeCode 等转换为不仅限于原客户端使用的API，从而供给OpenCode或其它客户端使用</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"></figure>
<h2 id="2.-%E6%90%AD%E5%BB%BA">2. 搭建</h2>
<p>首先选择一个目录，本文中使用的是<code>/data/sub2api</code></p>
<p>运行 <code>mkdir -p /data/sub2api &amp;&amp; touch /data/sub2api/compose.yaml</code> ，创建docker compose文件</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><img decoding="async" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-209355adb59d5a8794e976648539ca27.png" /></figure>
<p>复制以下docker compose 配置（8080端口太常见容易被占用所以这里我改成了6780，可自行修改为其它端口）</p>
<pre><code class="language-yaml">services:
  # ================= 主程序 =================
  sub2api:
    image: weishaw/sub2api:latest
    container_name: sub2api
    restart: unless-stopped
    ports:
      - "6780:8080"
    volumes:
      - ./data/sub2api:/app/data # 挂载到当前目录的 data/sub2api
    environment:
      - AUTO_SETUP=true # 开启自动初始化
      - TZ=Asia/Shanghai # 设置时区
      - SERVER_MODE=release # 运行模式
      - DATABASE_HOST=postgres
      - DATABASE_PORT=5432
      - DATABASE_USER=sub2api # 默认数据库用户
      - DATABASE_PASSWORD=sub2api_password # 默认数据库密码
      - DATABASE_DBNAME=sub2api # 默认数据库名
      - REDIS_HOST=redis
      - REDIS_PORT=6379
      - REDIS_PASSWORD=redis_password # 默认 Redis 密码
      - ADMIN_EMAIL=admin@sub2api.local # 默认管理员账号
      - ADMIN_PASSWORD=admin123456 # 默认管理员密码
      - JWT_SECRET= # 固定 JWT 密钥
      - TOTP_ENCRYPTION_KEY= # 固定 2FA 密钥
      - SECURITY_URL_ALLOWLIST_ENABLED=false # 禁用白名单检查
      - SECURITY_URL_ALLOWLIST_ALLOW_INSECURE_HTTP=true # 允许 HTTP URL（⚠️ 不安全）
    depends_on:
      postgres: { condition: service_healthy }
      redis: { condition: service_healthy }
    networks:
      - sub2api-network

  # ================= 数据库 (PostgreSQL) =================
  postgres:
    image: postgres:18-alpine
    container_name: sub2api-postgres
    restart: unless-stopped
    volumes:
      - ./data/postgres:/var/lib/postgresql/data # 挂载到当前目录的 data/postgres
    environment:
      - POSTGRES_USER=sub2api
      - POSTGRES_PASSWORD=sub2api_password
      - POSTGRES_DB=sub2api
      - PGDATA=/var/lib/postgresql/data 
      - TZ=Asia/Shanghai
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U sub2api -d sub2api"]
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - sub2api-network

  # ================= 缓存 (Redis) =================
  redis:
    image: redis:8-alpine
    container_name: sub2api-redis
    restart: unless-stopped
    volumes:
      - ./data/redis:/data # 挂载到当前目录的 data/redis
    command: ["redis-server", "--requirepass", "redis_password", "--appendonly", "yes"]
    environment:
      - REDISCLI_AUTH=redis_password
      - TZ=Asia/Shanghai
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - sub2api-network

networks:
  sub2api-network:
    driver: bridge</code></pre>
<p>粘贴到刚刚新建的 compose.yaml 里，可选修改数据库信息，<strong>请务必修改账号密码</strong></p>
<p>JWT密钥 和 2FA密钥 如果需要请自行生成（作用分别为）</p>
<p>如果使用HTTPS并且在意安全性，请删除 禁用白名单检查 和 允许HTTP URL 两项环境变量</p>
<p>如果只使用HTTP不使用HTTPS的话，这两个则似乎需要保留</p>
<figure style="align-items: center; display: flex; flex-direction: column;" data-content-type="image"><img decoding="async" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-655894299af80caa0ef577586416fc9d.png" /></figure>
<p>如果在上面修改了数据库信息，别忘了这里也要同步修改；如果没有修改则忽略此处</p>
<figure style="align-items: center; display: flex; flex-direction: column;" data-content-type="image"><img decoding="async" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-6812108873b4a685ecf137adbcfd2c9f.png" /></figure>
<p>修改好后运行如下命令 <code>cd /data/sub2api &amp;&amp; docker compose up -d</code> ，创建容器，如图即为成功</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><img decoding="async" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-2aabc491f45285a16cee55a8f84cbbe8.png" /></figure>
<h2 id="3.-%E9%85%8D%E7%BD%AE">3. 配置</h2>
<p>访问 服务器IP:6780 （如果你修改了端口则替换为你的端口），进入主页，点击登录</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-2d7e9fb2c7a5bb3c18b698669faa1e95.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-2d7e9fb2c7a5bb3c18b698669faa1e95.png" alt="" width="1910" height="929" /></a></figure>
<p>输入你在前面配置的账号密码，登录</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-fbe773ceab0c491b4aa051b1ae0bbfad.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-fbe773ceab0c491b4aa051b1ae0bbfad.png" alt="" width="1920" height="927" /></a></figure>
<p>可以看到sub2api已经给出了配置向导，可以根据向导进行配置，也可以跟着我的教程走</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-6b96b4df577b9f035fea29f321f444e1.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-6b96b4df577b9f035fea29f321f444e1.png" alt="" width="1910" height="927" /></a></figure>
<p>点击 分组管理 ，点击创建分组（不同的平台需要创建不同分组）</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-6b6010936d92a42ed58db0a4795ad160.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-6b6010936d92a42ed58db0a4795ad160.png" alt="" width="1920" height="927" /></a></figure>
<p>本文以对接Codex作为教程，其它大同小异，请自行研究</p>
<p>输入名称，平台选择OpenAI，点击创建</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-7af69903fa5e8725e9dc86eba11c0e9a.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-7af69903fa5e8725e9dc86eba11c0e9a.png" alt="" width="1920" height="927" /></a></figure>
<p>这里可以看见我们已经创建好的分组</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-69cca4731ab059a851750e31cb40a627.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-69cca4731ab059a851750e31cb40a627.png" alt="" width="1910" height="929" /></a></figure>
<p>点击账号管理，点击添加账号</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-e3e4f4b25b21f200b0b9d9f8ec4925a1.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-e3e4f4b25b21f200b0b9d9f8ec4925a1.png" alt="" width="1920" height="927" /></a></figure>
<p>填写名称，平台选择OpenAI，账号类型选择OAuth</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-e6a470f4e9fab2078e5d9fb3f082f6d1.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-e6a470f4e9fab2078e5d9fb3f082f6d1.png" alt="" width="1920" height="927" /></a></figure>
<p>注意要下拉勾选前面创建的分组 点击下一步</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-eaf5f8112828a5b2cdb6ad4f82883d3b.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-eaf5f8112828a5b2cdb6ad4f82883d3b.png" alt="" width="1920" height="927" /></a></figure>
<p>点击生成授权链接</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-7835e6b2c5af59f6e8e7f339aaeccf0f.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-7835e6b2c5af59f6e8e7f339aaeccf0f.png" alt="" width="1920" height="927" /></a></figure>
<p>可以看到生成的授权链接，复制到浏览器打开它</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-e71d7d0376f8e530d790a1a2fa685c8c.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-e71d7d0376f8e530d790a1a2fa685c8c.png" alt="" width="1920" height="927" /></a></figure>
<p>接下来按照提示登录</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><img decoding="async" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-960620ed7558978a27a1fb4f0578a19a.png" /></figure>
<p>登录后显示无法访问此网站，为正常现象，将网址栏的内容全部复制</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><img decoding="async" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-08e73f356eb587d6c35240713438e39a.png" /></figure>
<p>粘贴到如图所示位置，点击完成授权</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-e5041ec6a7b35ad90de41f8d53400beb.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-e5041ec6a7b35ad90de41f8d53400beb.png" alt="" width="1920" height="927" /></a></figure>
<p>可以看到我们刚刚添加的账号</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-e89e0fd67c290fcca4614e1db6153cfd.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-e89e0fd67c290fcca4614e1db6153cfd.png" alt="" width="1920" height="927" /></a></figure>
<p>接下来点击 API 密钥，点击创建密钥</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-d6a63ba31edc02da03ab3cd8efdd1bed.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-d6a63ba31edc02da03ab3cd8efdd1bed.png" alt="" width="1920" height="927" /></a></figure>
<p>填写名称，分组勾选我们之前创建的分组，点击创建</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-4c30d10a52a69c1e825b050a6617f6d2.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-4c30d10a52a69c1e825b050a6617f6d2.png" alt="" width="1920" height="927" /></a></figure>
<p>可以看到我们刚刚创建的 API 密钥</p>
<figure style="align-items: start; display: flex; flex-direction: column;" data-content-type="image"><a href="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-9b72d8b9073967ca9de204aa8e3fd906.png"><img decoding="async" class="alignnone" src="https://www.atomic-cube.cn/wp-content/uploads/2026/04/frc-9b72d8b9073967ca9de204aa8e3fd906.png" alt="" width="1920" height="927" /></a></figure>
<h2 id="4.-%E4%BD%BF%E7%94%A8">4. 使用</h2>
<p>到此已经完成，可以使用该密钥了，BaseURL 即为你的服务器IP:项目端口，点击上图中的使用密钥 可以看到相关配置，这个项目不能提供标准的OpenAI API ，似乎只能给 OpenCode 使用，这里就不过多赘述了</p>
<p>The post <a href="https://www.atomic-cube.cn/%e5%9f%ba%e4%ba%8edocker%e6%90%ad%e5%bb%basub2api%e5%9b%be%e6%96%87%e6%95%99%e7%a8%8b/">基于docker搭建sub2api图文教程</a> appeared first on <a href="https://www.atomic-cube.cn">原立方</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.atomic-cube.cn/%e5%9f%ba%e4%ba%8edocker%e6%90%ad%e5%bb%basub2api%e5%9b%be%e6%96%87%e6%95%99%e7%a8%8b/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>
