1财喳、檢查系統(tǒng)和內(nèi)核版本
cat /etc/centos-release
uname -a
image.png
2察迟、安裝系統(tǒng)依賴工具
yum install -y yum-utils device-mapper-persistent-data lvm2
image.png
3、yum的配置管理耳高,添加docker的軟件源地址
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
image.png
4扎瓶、更新yum緩存
yum makecache fast
image.png
5、可以查看所有倉庫中所有docker版本泌枪,并選擇特定版本安裝
yum list docker-ce --showduplicates | sort -r
image.png
6概荷、選擇docker版本安裝,由于repo中默認只開啟stable倉庫碌燕,這里安裝的是最新版本
yum install docker-ce 或者指定版本sudo yum install docker-ce-17.12.1.ce
image.png
7误证、啟動docker服務
systemctl start docker
8、加入開機啟動項
systemctl enable docker
image.png
9修壕、查看docker版本
docker version
image.png
10愈捅、如果安裝出錯時:
image.png
這個報錯是container-selinux版本低或者是沒安裝的原因
yum 安裝container-selinux 一般的yum源又找不到這個包
需要安裝epel源 才能yum安裝container-selinux
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install epel-release #阿里云上的epel源
再安裝container-selinux
yum install container-selinux
然后在安裝docker-ce就可以了。
yum install docker-ce-18.09.6 docker-ce-cli-18.09.6 containerd.io -y
image.png
image.png
至此叠殷,Docker 引擎的安裝就完成了改鲫。