欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 运维知识 > centos >内容正文

centos

Centos7下安装Docker1.8

发布时间:2025/5/22 centos 170 豆豆
生活随笔 收集整理的这篇文章主要介绍了 Centos7下安装Docker1.8 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

1.创建docker的yum库

[root@localhost~]# cd /etc/yum.repos.d/ [root@localhostyum.repos.d]# vim docker.repo [dockerrepo] name=DockerRepository baseurl=https://yum.dockerproject.org/repo/main/centos/7 enabled=1 gpgcheck=1 gpgkey=https://yum.dockerproject.org/gpg

2.安装docker

[root@localhost~]# yum install docker-engine

3.关闭centos7下的firewalld服务并安装iptables-ser

[root@localhost~]# systemctl disable firewalld rm'/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service' rm'/etc/systemd/system/basic.target.wants/firewalld.service' [root@localhost~]# yum -y install iptables-services

4.开启iptables服务

[root@localhost~]# systemctl enable iptables ln-s '/usr/lib/systemd/system/iptables.service''/etc/systemd/system/basic.target.wants/iptables.service' [root@localhost~]# systemctl start iptables

5.启动docker服务并设置开机自动启动

[root@localhost~]# systemctl start docker.service [root@localhost~]# systemctl enable docker.service ln-s '/usr/lib/systemd/system/docker.service''/etc/systemd/system/multi-user.target.wants/docker.service'

6.验证docker是否安装成功

[root@localhost~]# docker info

7.查看安装后的docker版本

[root@localhost~]# docker version

转载于:https://blog.51cto.com/linuxpython/1697036

总结

以上是生活随笔为你收集整理的Centos7下安装Docker1.8的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。