1、安装一些必要的系统工具:
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
2、添加软件源信息:
sudo yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3、更新 yum 缓存:
sudo yum makecache fast
4、安装 Docker-ce:
sudo yum -y install docker-ce
5、启动 Docker 后台服务
sudo systemctl start docker
6 、开启 ipv4 ip forwarding
/sbin/sysctl net.ipv4.conf.all.forwarding
/sbin/sysctl -w net.ipv4.conf.all.forwarding
/sbin/sysctl net.ipv4.conf.all.forwarding
7 如果需要安装指定版本,比如 17.03,由于 yum 源不加选择地应用所有版本的 docker-ce,导致冲突。解决方法:设置 --setopt=obsoletes=0
yum install --setopt=obsoletes=0 docker-ce-selinux-17.03.3.ce-1.el7.noarch docker-ce-17.03.3.ce-1.el7.x86_64
错误:Cannot connect to the Docker daemon at unix:///var/run/docker.sock.
docker已经安装,但是没有启动docker服务
参考: http://www.runoob.com/docker/centos-docker-install.html
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)