2023-05-03 22:50:12 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								---
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								hide:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  -  navigation
							 
						 
					
						
							
								
									
										
										
										
											2023-05-09 22:04:55 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  -  feedback
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  -  footer
							 
						 
					
						
							
								
									
										
										
										
											2023-05-03 22:50:12 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								---
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-25 10:21:28 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								## :fontawesome-brands-docker:{style="color: #086dd7"} Docker 安装脚本
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								支持 `选择或更换软件源以及镜像仓库` 、`安装指定版本` 、`重装`  等功能  
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								脚本参考 [官方文档 ](https://docs.docker.com/engine/install ) 使用包管理工具实现安装,支持的系统详见下方表格
							 
						 
					
						
							
								
									
										
										
										
											2023-05-10 19:39:29 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								< table > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								< tr > 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-25 10:21:28 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    < td > < a  href = "https://www.debian.org"  target = "_blank" > < img  src = "/assets/images/icon/debian.svg"  width = "16"  height = "16"  style = "vertical-align: -0.35em" > < / a >  Debian< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    < td > < a  href = "https://access.redhat.com/products/red-hat-enterprise-linux"  target = "_blank" > < img  src = "/assets/images/icon/redhat.svg"  width = "16"  height = "16"  style = "vertical-align: -0.1em" > < / a >  Red Hat Enterprise Linux< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								< / tr > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								< tr > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    < td > < a  href = "https://cn.ubuntu.com"  target = "_blank" > < img  src = "/assets/images/icon/ubuntu.svg"  width = "16"  height = "16"  style = "vertical-align: -0.15em" > < / a >  Ubuntu< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    < td > < a  href = "https://fedoraproject.org/zh-Hans"  target = "_blank" > < img  src = "/assets/images/icon/fedora.ico"  width = "16"  height = "16"  style = "vertical-align: -0.2em" > < / a >  Fedora< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								< / tr > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								< tr > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    < td > < a  href = "https://www.kali.org"  target = "_blank" > < img  src = "/assets/images/icon/kali-linux.svg"  width = "16"  height = "16" > < / a >  Kali Linux< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    < td > < a  href = "https://www.centos.org"  target = "_blank" > < img  src = "/assets/images/icon/centos.svg"  width = "16"  height = "16"  style = "vertical-align: -0.2em" > < / a >  CentOS< / td > 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-10 19:39:29 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								< / tr > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								< tr > 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-25 10:21:28 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    < td > < a  href = "https://linuxmint.com"  target = "_blank" > < img  src = "/assets/images/icon/linux-mint.ico"  width = "16"  height = "16"  style = "vertical-align: -0.15em" > < / a >  Linux Mint< / td > 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-26 04:15:23 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    < td > < a  href = "https://rockylinux.org"  target = "_blank" > < img  src = "/assets/images/icon/rocky-linux.svg"  width = "16"  height = "16"  style = "vertical-align: -0.25em" > < / a >  Rocky Linux< / td > 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-10 19:39:29 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								< / tr > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								< tr > 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-25 10:21:28 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    < td > < a  href = "https://www.deepin.org"  target = "_blank" > < img  src = "/assets/images/icon/deepin.svg"  width = "16"  height = "16"  style = "vertical-align: -0.3em" > < / a >  Deepin< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    < td > < a  href = "https://almalinux.org/zh-hans"  target = "_blank" > < img  src = "/assets/images/icon/almalinux.svg"  width = "16"  height = "16"  style = "vertical-align: -0.25em" > < / a >  AlmaLinux< / td > 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-10 19:39:29 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								< / tr > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								< tr > 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-25 10:21:28 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    < td > < a  href = "https://www.armbian.com"  target = "_blank" > < img  src = "/assets/images/icon/armbian.png"  width = "16"  height = "16"  style = "vertical-align: -0.2em" > < / a >  Armbian< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    < td > < a  href = "https://www.opencloudos.org"  target = "_blank" > < img  src = "/assets/images/icon/opencloudos.png"  width = "16"  height = "16"  style = "vertical-align: -0.25em" > < / a >  OpenCloudOS< / td > 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-10 19:39:29 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								< / tr > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								< tr > 
							 
						 
					
						
							
								
									
										
										
										
											2024-07-25 10:21:28 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    < td > < a  href = "https://www.proxmox.com"  target = "_blank" > < img  src = "/assets/images/icon/proxmox.svg"  width = "16"  height = "16"  style = "vertical-align: -0.2em" > < / a >  Proxmox< / td > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    < td > < a  href = "https://www.openeuler.org/zh"  target = "_blank" > < img  src = "/assets/images/icon/openeuler.ico"  width = "16"  height = "16"  style = "vertical-align: -0.2em" > < / a >  openEuler< / td > 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-10 19:39:29 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								< / tr > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								< / table > 
							 
						 
					
						
							
								
									
										
										
										
											2023-05-03 22:50:12 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								``` bash
							 
						 
					
						
							
								
									
										
										
										
											2023-05-05 22:38:53 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								bash < (curl -sSL https://linuxmirrors.cn/docker.sh)
							 
						 
					
						
							
								
									
										
										
										
											2023-05-03 22:50:12 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-06-20 06:04:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								??? quote "原始执行脚本方法"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-06-24 11:06:30 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    === ":simple-github: GitHub"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        ``` bash
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        bash < (curl -sSL https://raw.githubusercontent.com/SuperManito/LinuxMirrors/main/DockerInstallation.sh)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        ```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    === ":simple-gitee: Gitee"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        ``` bash
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        bash < (curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/DockerInstallation.sh)
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        ```
							 
						 
					
						
							
								
									
										
										
										
											2023-06-20 06:04:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-05-08 18:49:07 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								!!! node ""
							 
						 
					
						
							
								
									
										
										
										
											2023-05-03 22:50:12 +08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-12-30 00:07:34 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    脚本集成安装 [`Docker Engine` ](https://docs.docker.com/engine ) 和 [`Docker Compose` ](https://docs.docker.com/compose ),可选择安装版本、下载软件源、镜像加速器,支持海内外服务器环境和 `arm`  架构处理器环境使用
							 
						 
					
						
							
								
									
										
										
										
											2023-05-10 19:39:29 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-06-21 11:39:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    `Docker CE`  软件仓库,全称 Docker Community Edition (Docker 社区版),用于下载并安装 Docker 相关软件包  
							 
						 
					
						
							
								
									
										
										
										
											2023-07-03 19:56:26 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    `Docker Registry`  镜像仓库,用于控制下载镜像的默认来源存储仓库,又称镜像加速器,默认为官方的 Docker Hub 仓库
							 
						 
					
						
							
								
									
										
										
										
											2023-05-10 19:39:29 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								### 命令选项
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								| 名称 | 含义 | 选项值 |
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								| :-: | :-: | :-: |
							 
						 
					
						
							
								
									
										
										
										
											2023-06-24 11:06:30 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								| `--source`  | 指定 `Docker CE`  源地址(域名或IP) | 地址 |
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								| `--source-registry`  | 指定镜像仓库地址(域名或IP) | 地址 |
							 
						 
					
						
							
								
									
										
										
										
											2024-01-18 12:15:13 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								| `--codename`  | 指定 Debian 系操作系统的版本代号 | 代号名称 |
							 
						 
					
						
							
								
									
										
										
										
											2023-06-20 06:04:56 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								| `--install-latested`  | 控制是否安装最新版本的 Docker Engine | `true`  或 `false`  |
							 
						 
					
						
							
								
									
										
										
										
											2023-05-10 19:39:29 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								| `--ignore-backup-tips`  | 忽略覆盖备份提示(即不覆盖备份) | 无 |
							 
						 
					
						
							
								
									
										
										
										
											2023-05-05 22:38:53 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-06-24 11:06:30 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								>  软件源格式 `<指定WEB协议>://<软件源地址>/<软件源分支>`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2023-06-19 20:35:50 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								### 关于服务报错无法启动
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								!!! quote ""
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    非新装环境可能会在运行脚本后遇到 `Docker`  服务无法启动的情况,建议重新安装来解决,卸载不会删除镜像和容器数据
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    卸载命令如下:
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-01-17 17:14:51 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    === "Debian 系"
							 
						 
					
						
							
								
									
										
										
										
											2023-06-19 20:35:50 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        ``` bash
							 
						 
					
						
							
								
									
										
										
										
											2023-07-25 21:08:46 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        apt-get remove -y docker* containerd.io runc & &  apt-get autoremove
							 
						 
					
						
							
								
									
										
										
										
											2023-06-19 20:35:50 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        ```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-07-25 10:21:28 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        >  `Debian`   `Ubuntu`   `Kali`   `Linux Mint`   `Deepin`   `Armbian`   `Proxmox`
 
							 
						 
					
						
							
								
									
										
										
										
											2023-06-19 20:35:50 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2024-01-17 17:14:51 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    === "RedHat 系 / OpenCloudOS / openEuler"
							 
						 
					
						
							
								
									
										
										
										
											2023-06-19 20:35:50 +08:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        ``` bash
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        yum remove -y docker* containerd.io podman* runc
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        ```
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        >  `Red Hat Enterprise Linux`   `CentOS`   `Rocky Linux`   `AlmaLinux`   `Fedora`   `OpenCloudOS`   `openEuler`
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    卸载完成后重新执行脚本安装即可