環(huán)境要求
基礎(chǔ)環(huán)境
[root@VM_59_161_centos ~]# uname -r
3.10.0-514.21.1.el7.x86_64
[root@VM_59_161_centos ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
安裝docker
安裝需要的軟件包
[root@VM_59_161_centos ~]# yum install -y yum-utils
設(shè)置阿里云鏡像倉(cāng)庫(kù)
[root@VM_59_161_centos ~]# sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
Loaded plugins: fastestmirror, langpacks
Repository epel is listed more than once in the configuration
adding repo from: http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
grabbing file http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
[root@VM_59_161_centos ~]#
更新yum軟件包索引
推薦安裝docker-ce
[root@VM_59_161_centos ~]# yum makecache fast
安裝docker
推薦安裝docker-ce
[root@VM_59_161_centos ~]# yum install docker-ce docker-ce-cli containerd.io
啟動(dòng)docker,查看版本
推薦安裝docker-ce
[root@VM_59_161_centos ~]# systemctl start docker
[root@VM_59_161_centos ~]# docker --version
Docker version 20.10.0, build 7287ab3
到此為止,docker已成功安裝