🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
docker分企业版(EE)和社区版(CE) # 1. 配置yum源 > 安装yum-utils,Install the`yum-utils`package (which provides the`yum-config-manager`utility) and set up the **stable** repository. ~~~ yum install yum-utils -y yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo ~~~ # 2. 安装docker引擎 > 查询有哪些可用的docker版本 ~~~ yum list docker-ce --showduplicates | sort -r ~~~ ``` [root@bogon ~]# yum list docker-ce --showduplicates | sort -r 已加载插件:fastestmirror 可安装的软件包 * updates: mirrors.aliyun.com Loading mirror speeds from cached hostfile * extras: mirrors.aliyun.com docker-ce.x86_64 3:20.10.6-3.el7 docker-ce-stable docker-ce.x86_64 3:20.10.5-3.el7 docker-ce-stable docker-ce.x86_64 3:20.10.4-3.el7 docker-ce-stable docker-ce.x86_64 3:20.10.3-3.el7 docker-ce-stable docker-ce.x86_64 3:20.10.2-3.el7 docker-ce-stable docker-ce.x86_64 3:20.10.1-3.el7 docker-ce-stable docker-ce.x86_64 3:20.10.0-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.9-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.8-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.7-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.6-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.5-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.4-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.3-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.2-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.15-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.14-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.1-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.13-3.el7 docker-ce-stable docker-ce.x86_64 3:19.03.12-3.el7 docker-ce-stable ``` 最新的是20年10月份的版本,不指定版本默认安装最新版本 ~~~ sudo yum install docker-ce-<VERSION_STRING> docker-ce-cli-<VERSION_STRING> containerd.io ~~~ ``` * containerd.io - daemon to interface with the OS API (in this case, LXC - Linux Containers), essentially decouples Docker from the OS, also provides container services for non-Docker container managers * docker-ce - Docker daemon, this is the part that does all the management work, requires the other two on Linux * docker-ce-cli - CLI tools to control the daemon, you can install them on their own if you want to control a remote Docker daemon ``` **这里只按照docker服务** ``` yum install -y docker-ce-20.10.6-3.el7 ``` # 3. 启动docker ~~~ systemctl start docker systemctl enable docker ~~~ # 4. docker配置阿里源加速器 docker安装后默认没有daemon.json这个配置文件,需要进行手动创建。进入阿里云镜像中心 https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors ![](https://img.kancloud.cn/28/79/28790812c9479d646b81132c34a36704_802x432.png) ~~~ mkdir -p /etc/docker tee /etc/docker/daemon.json <<-'EOF' { "registry-mirrors": ["https://l821m9dk.mirror.aliyuncs.com"] } EOF systemctl daemon-reload systemctl restart docker ~~~