<?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镜像归档 - Liao&#039;s blog</title>
	<atom:link href="https://www.laobaiblog.top/tag/%E5%9B%BD%E5%86%85%E8%AE%BF%E9%97%AEdocker%E9%95%9C%E5%83%8F/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.laobaiblog.top/tag/国内访问docker镜像/</link>
	<description>路漫漫其修远兮，吾将上下而求索</description>
	<lastBuildDate>Tue, 16 Jul 2024 07:30:10 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.laobaiblog.top/wp-content/uploads/2022/01/cropped-tyuu-32x32.png</url>
	<title>国内访问Docker镜像归档 - Liao&#039;s blog</title>
	<link>https://www.laobaiblog.top/tag/国内访问docker镜像/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Docker仓库镜像代理打造属于自己的Docker Hub</title>
		<link>https://www.laobaiblog.top/2024/07/16/docker%e4%bb%93%e5%ba%93%e9%95%9c%e5%83%8f%e4%bb%a3%e7%90%86%e6%89%93%e9%80%a0%e5%b1%9e%e4%ba%8e%e8%87%aa%e5%b7%b1%e7%9a%84docker-hub/</link>
		
		<dc:creator><![CDATA[大白]]></dc:creator>
		<pubDate>Tue, 16 Jul 2024 07:22:31 +0000</pubDate>
				<category><![CDATA[Docker]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[分享]]></category>
		<category><![CDATA[Cldouflare]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[Docker Hub]]></category>
		<category><![CDATA[Pages]]></category>
		<category><![CDATA[Workers]]></category>
		<category><![CDATA[国内访问Docker镜像]]></category>
		<category><![CDATA[镜像代理]]></category>
		<category><![CDATA[镜像加速]]></category>
		<guid isPermaLink="false">https://www.laobaiblog.top/?p=491</guid>

					<description><![CDATA[<p>本博文基于原博CMLiussss Blog编写，旨在中转对 Docker 官方镜像仓库，帮助国内用户 &#8230;</p>
<p><a href="https://www.laobaiblog.top/2024/07/16/docker%e4%bb%93%e5%ba%93%e9%95%9c%e5%83%8f%e4%bb%a3%e7%90%86%e6%89%93%e9%80%a0%e5%b1%9e%e4%ba%8e%e8%87%aa%e5%b7%b1%e7%9a%84docker-hub/">Docker仓库镜像代理打造属于自己的Docker Hub</a>最先出现在<a href="https://www.laobaiblog.top">Liao&#039;s blog</a>。</p>
]]></description>
										<content:encoded><![CDATA[<blockquote><p>
  本博文基于<a class="wp-editor-md-post-content-link" href="https://blog.090227.xyz/p/CF-Workers-docker.io/">原博CMLiussss Blog</a>编写，旨在中转对 Docker 官方镜像仓库，帮助国内用户访问被墙的Docker hub，只建议私人或公司内部使用，不推荐使用该项目搭建公共服务。使用你自己的域名搭建公共服务有可能会遭受<strong>污染、反诈或被墙</strong>，推荐小规模自用即可。
</p></blockquote>
<h3>环境准备</h3>
<ul>
<li><strong><a class="wp-editor-md-post-content-link" href="https://github.com/login">GitHub账号</a></strong></li>
<li><strong><a class="wp-editor-md-post-content-link" href="https://dash.cloudflare.com/login">Cloudflare账号</a></strong></li>
<li><strong>一个属于自己的域名</strong></li>
</ul>
<hr />
<h3>一、Docker代理工具介绍</h3>
<p><strong><a class="wp-editor-md-post-content-link" href="https://github.com/cmliu/CF-Workers-docker.io">本项目</a>是一个基于 <a class="wp-editor-md-post-content-link" href="https://github.com/cmliu/CF-Workers-docker.io">Cloudflare Workers 的 Docker 镜像代理工具</a>，旨在中转对 Docker 官方镜像仓库的请求，解决访问限制并加速访问。</strong></p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_54e68b1d728e37cc1b057801abf85a92.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_54e68b1d728e37cc1b057801abf85a92.jpg" alt="" /></a></p>
<h4>为什么需要这个工具？</h4>
<p>由于<strong>神秘原因</strong>，国内用户逐渐无法访问Docker Hub仓库。这对于我们开发者来说是个不小的难题。<br />
<a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_c53beb24b163c998a0165abb6f568c6d.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_c53beb24b163c998a0165abb6f568c6d.jpg" alt="" /></a></p>
<hr />
<h3>二、GitHub Fork本项目</h3>
<p><strong>点击 <a class="wp-editor-md-post-content-link" href="https://github.com/cmliu/CF-Workers-docker.io">Github项目</a>中的<code>Fork</code>到本地自己的仓库即可。</strong></p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_0e00ec03a8460fa925fa682908356f15.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_0e00ec03a8460fa925fa682908356f15.jpg" alt="" /></a></p>
<hr />
<h3>三、登录Cloudflare创建Pages自动化</h3>
<p><strong>登录 <a class="wp-editor-md-post-content-link" href="https://dash.cloudflare.com/login">cloudflare</a> ，点击<code>Works和Pages并创建</code>，选择<code>Pages</code>再连接到刚才我们Fork到Github本地仓库的项目</strong></p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_76dad882587baf9cc54c944df2618a9e.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_76dad882587baf9cc54c944df2618a9e.jpg" alt="" /></a></p>
<hr />
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_a34eaf7dcacdd2a28d70807887cb2942.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_a34eaf7dcacdd2a28d70807887cb2942.jpg" alt="" /></a></p>
<hr />
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_86ba8012e8339c2a42b9409ddfedc8ab.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_86ba8012e8339c2a42b9409ddfedc8ab.jpg" alt="" /></a></p>
<hr />
<h3>四、开始部署设置</h3>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_e74f76e3b13e8fb90924dd6c42b6ed77.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_e74f76e3b13e8fb90924dd6c42b6ed77.jpg" alt="" /></a></p>
<p><strong>部署完成后可以进入Pages里的自动化项目，给它设置一个自定义域名。假如我有一个顶级域名：<code>laobaiblog.top</code>，那我可以再自定义域名中配置一个：<code>docker.laobaiblog.top</code>作为我的Docker代理域名。</strong></p>
<hr />
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_7bf1740f0ea23278e45d721a9670e861.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_7bf1740f0ea23278e45d721a9670e861.jpg" alt="" /></a></p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_cbb717c6ddab71dc8f27120b9f7fb026.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_cbb717c6ddab71dc8f27120b9f7fb026.jpg" alt="" /></a></p>
<p><strong>选择DNS解析，在域名解析中添加上Cloudflare生成给你的<code>CNAME记录</code>。</strong></p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_5f933d2a167bf8dee77028eef8dc2e44.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_5f933d2a167bf8dee77028eef8dc2e44.jpg" alt="" /></a></p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_9b62328b1e2623cae1dd08273937c5cd.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_9b62328b1e2623cae1dd08273937c5cd.jpg" alt="" /></a></p>
<p><strong>在你自己的域名解析管理中，添加CNAME记录，填入<code>主机记录</code>及<code>记录值</code>参数，等待5分钟后检查DNS记录。完成后访问代理域名会发现自动跳转为官网Docker Hub，且无需翻墙就说明已经实现了docker镜像代理。</strong></p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_831105c29803556dddd33044e0c27f87.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_831105c29803556dddd33044e0c27f87.jpg" alt="" /></a></p>
<h4>地址栏输入你的自定义域名搜索镜像查询，毫无压力。</h4>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_fde65cd2e8d255a3d7be1a361546fb15.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_fde65cd2e8d255a3d7be1a361546fb15.jpg" alt="" /></a></p>
<hr />
<h3>五、配置验证</h3>
<p><strong>在国内服务器上拉取镜像发现无法拉取，一直显示等待连接，各个大厂的镜像源都无法使用或仅内部使用。</strong></p>
<pre><code class="language-shell line-numbers">docker pull nginx
</code></pre>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_c42c15e2933dbf64781e4dde383a515d.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_c42c15e2933dbf64781e4dde383a515d.jpg" alt="" /></a></p>
<hr />
<p><strong>拉取镜像时加上自己代理的域名。拉取镜像仓库的命令 <code>docker pull docker.laobaiblog.top/nginx</code> 即可拉取镜像。</strong></p>
<pre><code class="language-shell line-numbers">docker pull docker.laobaiblog.top/nginx
</code></pre>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_8dfc141d01a9a43a184d395b3e677dd0.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_8dfc141d01a9a43a184d395b3e677dd0.jpg" alt="" /></a></p>
<p><strong>你甚至可以将你的域名配置在<code>daemon.json</code>中，即可直接使用<code>docker pull nginx</code>无需再加上域名的前缀。在这里也提供了一些大佬无私分享的代理域名。</strong></p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_a3cf47fc63957e428b02f1a13124bd95.jpg"><img decoding="async" src="https://www.laobaiblog.top/wp-content/uploads/2024/07/wp_editor_md_a3cf47fc63957e428b02f1a13124bd95.jpg" alt="" /></a></p>
<pre><code class="language-shell line-numbers">#编辑daemon.json
vim /etc/docker/daemon.json
:wq

#重启daemon配置
systemctl daemon-reload

#重启docker
systemctl restart docker.service

</code></pre>
<hr />
<table>
<thead>
<tr>
<th>DockerHub 镜像仓库</th>
<th>镜像地址</th>
</tr>
</thead>
<tbody>
<tr>
<td>bestcfipas镜像服务</td>
<td>https://docker.registry.cyou</td>
</tr>
<tr>
<td></td>
<td>https://docker-cf.registry.cyou</td>
</tr>
<tr>
<td>zero_free镜像服务</td>
<td>https://docker.jsdelivr.fyi</td>
</tr>
<tr>
<td></td>
<td>https://dockercf.jsdelivr.fyi</td>
</tr>
<tr>
<td></td>
<td>https://dockertest.jsdelivr.fyi</td>
</tr>
<tr>
<td>docker proxy</td>
<td>https://dockerpull.com</td>
</tr>
<tr>
<td></td>
<td>https://dockerproxy.cn</td>
</tr>
<tr>
<td>Docker镜像加速站</td>
<td>https://hub.uuuadc.top</td>
</tr>
<tr>
<td></td>
<td>https://docker.1panel.live</td>
</tr>
<tr>
<td></td>
<td>https://hub.rat.dev</td>
</tr>
</tbody>
</table>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/2022/01/18/centos7%e5%ae%89%e8%a3%85docker%e5%b9%b6%e6%9b%b4%e6%94%b9%e9%bb%98%e8%ae%a4%e5%ad%98%e5%82%a8%e6%96%87%e4%bb%b6%e4%bd%8d%e7%bd%ae/" title="Centos7安装Docker并更改默认存储文件位置">Centos7安装Docker并更改默认存储文件位置</a></p>
<p><a class="wp-editor-md-post-content-link" href="https://www.laobaiblog.top/2022/02/23/centos7%e7%a6%bb%e7%ba%bf%e5%ae%89%e8%a3%85docker-ce/" title="CentOS7离线安装docker-ce">CentOS7离线安装docker-ce</a></p>
<p><a href="https://www.laobaiblog.top/2024/07/16/docker%e4%bb%93%e5%ba%93%e9%95%9c%e5%83%8f%e4%bb%a3%e7%90%86%e6%89%93%e9%80%a0%e5%b1%9e%e4%ba%8e%e8%87%aa%e5%b7%b1%e7%9a%84docker-hub/">Docker仓库镜像代理打造属于自己的Docker Hub</a>最先出现在<a href="https://www.laobaiblog.top">Liao&#039;s blog</a>。</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
