mirror of
				https://github.com/yeasy/docker_practice.git
				synced 2025-10-30 18:02:08 +00:00 
			
		
		
		
	Update mirror: check docker.service first
Signed-off-by: Kang Huaishuai <khs1994@khs1994.com>
This commit is contained in:
		
							
								
								
									
										1
									
								
								.github/workflows/check-link.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.github/workflows/check-link.yml
									
									
									
									
										vendored
									
									
								
							| @@ -62,7 +62,6 @@ jobs: | ||||
|           "x.x.x.x/base",\ | ||||
|           "x.x.x.x:9000/minio/",\ | ||||
|           "yeasy.gitbooks.io",\ | ||||
|           "https://www.freedesktop.org/wiki/Software/systemd/",\ | ||||
|           "www.aliyun.com" \ | ||||
|           --allow-dupe \ | ||||
|           --skip-save-results \ | ||||
|   | ||||
| @@ -12,9 +12,19 @@ | ||||
|  | ||||
| 本节我们以 [网易云](https://www.163yun.com/) 镜像服务 `https://hub-mirror.c.163.com` 为例进行介绍。 | ||||
|  | ||||
| ## Ubuntu 16.04+、Debian 8+、CentOS 7 | ||||
| ## Ubuntu 16.04+、Debian 8+、CentOS 7+ | ||||
|  | ||||
| 对于使用 [systemd](https://www.freedesktop.org/wiki/Software/systemd/) 的系统,请在 `/etc/docker/daemon.json` 中写入如下内容(如果文件不存在请新建该文件) | ||||
| 目前主流 Linux 发行版均已使用 [systemd](https://systemd.io/) 进行服务管理,这里介绍如何在使用 systemd 的 Linux 发行版中配置镜像加速器。 | ||||
|  | ||||
| 请首先执行以下命令,查看是否在 `docker.service` 文件中配置过镜像地址。 | ||||
|  | ||||
| ```bash | ||||
| $ systemctl cat docker | grep '\-\-registry\-mirror' | ||||
| ``` | ||||
|  | ||||
| 如果该命令有输出,那么请执行 `$ systemctl cat docker` 查看 `ExecStart=` 出现的位置,修改对应的文件内容去掉 `--registry-mirror` 参数及其值,并按接下来的步骤进行配置。 | ||||
|  | ||||
| 如果以上命令没有任何输出,那么就可以在 `/etc/docker/daemon.json` 中写入如下内容(如果文件不存在请新建该文件): | ||||
|  | ||||
| ```json | ||||
| { | ||||
| @@ -34,8 +44,6 @@ $ sudo systemctl daemon-reload | ||||
| $ sudo systemctl restart docker | ||||
| ``` | ||||
|  | ||||
| >注意:如果您之前查看旧教程,修改了 `docker.service` 文件内容,请去掉您添加的内容(`--registry-mirror=https://hub-mirror.c.163.com`)。 | ||||
|  | ||||
| ## Windows 10 | ||||
|  | ||||
| 对于使用 `Windows 10` 的用户,在任务栏托盘 Docker 图标内右键菜单选择 `Settings`,打开配置窗口后在左侧导航菜单选择 `Docker Engine`,在右侧像下边一样编辑 json 文件,之后点击 `Apply & Restart` 保存后 Docker 就会重启并应用配置的镜像地址了。 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user