首页 > 其他 > 详细

centos7安装docker1.31

时间:2018-05-13 17:45:27      阅读:553      评论:0      收藏:0      [点我收藏+]

1 首先使用yum 安装docker,yum install docker -y。使用docker -v检查docker是否安装成功

技术分享图片

2 因为docker使用了iptables的映射规则,而centos7的防火墙是firewall,需要停用 firewall,安装并设置iptables.

具体命令如下:

systemctl stop firewalld  \

&& systemctl disable firewalld  \

&& yum -y install iptables-services  \

&& systemctl  enable iptables  \

&& systemctl  start iptables

3 如果centos7版本的内核比较旧,如我的安装完内核是3.10。需要升级linux内核或者修改配置文件。否则启动docker会出现如下错误

Error starting daemon: SELinux is not supported with the overlay2 graph driver on this kernel. Either boot into a newer kernel

or disable selinux in docker (--selinux-enabled=false)

      如果想更改配置文件:执行命令,vi /etc/sysconfig/docker

     技术分享图片

     修改为

     技术分享图片

     B  升级linux内核

      可以使用如下命令   

yum update nss \
&& rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org \
&& rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm \
&& yum clean all \
&& yum --enablerepo=elrepo-kernel install kernel-ml -y \
&& grub2-set-default 0

升级完重启一下系统。ok

 

         可以通过cat /proc/version 查看内核版本,我安装完的linux内核是3.10.0

技术分享图片

 

 4  启动docker service命令systemctl start docker,可以通过systemctl status 查看docker状态。

      

 参考:

https://blog.csdn.net/a1010256340/article/details/80106156

https://blog.phpgao.com/update_linux_kernel.html

 

centos7安装docker1.31

原文:https://www.cnblogs.com/SimpleCode/p/9032690.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!