前提条件
目前,CentOS 仅发行版本中的内核支持 Docker。
Docker 运行在 CentOS 7 上,要求系统为64位、系统内核版本为 3.10 以上。
Docker 运行在 CentOS-6.5 或更高的版本的 CentOS 上,要求系统为64位、系统内核版本为 2.6.32-431 或者更高版本。
安装一些必要的系统工具
yum install -y yum-utils device-mapper-persistent-data lvm2
添加软件源信息:
yum-config-manager --add-repo
更新 yum 缓存: yum makecache fast
安装 Docker-ce:
yum -y install docker-ce
--> Processing Dependency: libseccomp.so.2()(64bit) for package: 3:docker-ce-18.09.0-3.el7.x86_64--> Processing Dependency: libsystemd.so.0()(64bit) for package: 3:docker-ce-18.09.0-3.el7.x86_64---> Package docker-ce-cli.x86_64 1:18.09.0-3.el7 will be installed--> Finished Dependency ResolutionError: Package: 3:docker-ce-18.09.0-3.el7.x86_64 (docker-ce-stable) Requires: libsystemd.so.0()(64bit)Error: Package: 3:docker-ce-18.09.0-3.el7.x86_64 (docker-ce-stable) Requires: container-selinux >= 2.9Error: Package: containerd.io-1.2.0-3.el7.x86_64 (docker-ce-stable) Requires: systemdError: Package: 3:docker-ce-18.09.0-3.el7.x86_64 (docker-ce-stable) Requires: libseccomp.so.2()(64bit)Error: Package: 3:docker-ce-18.09.0-3.el7.x86_64 (docker-ce-stable) Requires: libc.so.6(GLIBC_2.17)(64bit)Error: Package: 3:docker-ce-18.09.0-3.el7.x86_64 (docker-ce-stable) Requires: systemd-unitsError: Package: 3:docker-ce-18.09.0-3.el7.x86_64 (docker-ce-stable) Requires: libsystemd.so.0(LIBSYSTEMD_209)(64bit) You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest[root@computer7 ~]#
解决方法:升级内核(带aufs模块)
cd
/etc/yum
.repos.d
wget http:
//www
.hop5.
in
/yum/el6/hop5
.repo
yum
install
kernel-ml-aufs kernel-ml-aufs-devel
修改grub的主配置文件/etc/grub.conf,设置default=0,表示第一个title下的内容为默认启动的kernel(一般新安装的内核在第一个位置)。
重启系统,这时候你的内核就成功升级了。
查看内核是否支持aufs:
grep aufs /proc/filesystems
在Fedora EPEL源中已经提供了docker-io包,下载安装epel:
|
yum安装docker-io:
yum -y
install
docker-io
service docker start
docker --version
refer to :