-
系統環境(docker 官方要求內核3.10, 可是Oracle Linux有使用3.8版本的特例)
背景:rhel7.0 更改yum源,升級了一次後顯示爲Centos 7.6的版本, 內核3.10
-
安裝:docker 18.09.3
正常按照官方步驟安裝:
1.卸載舊版本
yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine
2.設置存儲庫
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
3.安裝docker社區版
yum install docker-ce-18.09.3
3.1 安裝報錯,提示container-selinux>2.74, rpm覆蓋安裝2.74
wget http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.74-1.el7.noarch.rpm
rpm -Uvh container-selinux-2.74-1.el7.noarch.rpm --nodeps
4.啓動docker
systemctl start docker
-
啓動錯誤
錯誤:Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
錯誤詳情:
查看journalctl -xe的詳細報錯信息:
查詢得知是mkfs.xfs版本過低,而後更新:
yum update xfsprogs # 本次更新完版本 xfsprogs-4.5.0-19.el7_6.x86_64.rpm
-
關閉,重啓docker,就能夠了
systemctl stop docker
systemctl start docker
-
PS以前安裝報錯的一些不成功操做:本來默認安裝docker-ce最新版19.03,也是啓動失敗, 因而本次嘗試安裝18.09.3
1.SELinux is not supported with the overlay2 graph driver on this kernel. 更新配置
cat /etc/docker/daemon.json
{
"graph": "/mnt/docker-data",
"storage-driver": "overlay"
} # 無效
2.升級內核,到5.2.8, 仍是沒用