CentOS8安装Docker
前言
版本说明
centos=8
参考链接
- CentOS 安装 docker 官方教程:https://docs.docker.com/engine/install/centos/
- Docker RPM 安装包和依赖包地址 :https://download.docker.com/linux/centos/
- containerd.io 依赖包地址:https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
下载旧版本
sudo yum remove docker \ docker-client \ docker-client-latest \ docker-common \ docker-latest \ docker-latest-logrotate \ docker-logrotate \ docker-engine
前置依赖安装
containerd.io 安装
containerd.io 依赖包地址:https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
# 下载 wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.2.6-3.3.el7.x86_64.rpm # 安装 containerd.io sudo yum install containerd.io-1.2.6-3.3.el7.x86_64.rpm -y
Docker 安装
脚本安装
# 更新 yum sudo yum update -y # 下载 Docker 脚本 curl -fsSL https://get.docker.com -o get-docker.sh # 执行 Docker 脚本 sudo sh get-docker.sh # docker 伴随宿主机启动而启动 sudo systemctl enable docker
YUM 安装
# 安装 yum-utils sudo yum install -y yum-utils # 设置Docker存储库 sudo yum-config-manager \ --add-repo \ https://download.docker.com/linux/centos/docker-ce.repo # 安装 docker sudo yum install docker-ce docker-ce-cli containerd.io -y
RPM 安装
# 下载 docker-ce-cli wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-cli-19.03.9-3.el7.x86_64.rpm # 安装 docker-ce-cli yum install docker-ce-cli-19.03.9-3.el7.x86_64.rpm -y # 下载 docker rpm 安装包 wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-19.03.9-3.el7.x86_64.rpm # 安装 yum install docker-ce-19.03.9-3.el7.x86_64.rpm -y