重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

CentOS7怎么部署19版的docker

这篇文章主要讲解了“CentOS7怎么部署19版的docker”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“CentOS7怎么部署19版的docker”吧!

创新互联-专业网站定制、快速模板网站建设、高性价比新邵网站开发、企业建站全套包干低至880元,成熟完善的模板库,直接使用。一站式新邵网站制作公司更省心,省钱,快速模板网站建设找我们,业务覆盖新邵地区。费用合理售后完善,十载实体公司更值得信赖。

1、安装依赖包

[root@localhost ~]# yum install -y yum-utils device-mapper-persistent-data lvm2

2、设置阿里云镜像源

[root@localhost ~]# yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

3、安装docker-ce

[root@localhost ~]# yum install -y docker-ce

4、关闭防火墙与增强型安全功能

[root@localhost ~]# systemctl stop firewalld.service
[root@localhost ~]# setenforce 0
[root@localhost ~]#

5、开启服务,并设为开机自启

[root@localhost ~]# systemctl start docker.service
[root@localhost ~]# systemctl enable docker.service
created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@localhost ~]#

6、设置阿里云镜像加速

(1)进入阿里云首页,选择登陆,没有账号的可以注册一个

(2)登陆成功后选择控制台

(3)选择产品与服务,然后选择容器镜像服务

(4)选择最下面的镜像加速器,这时候就可以根据你的系统提供相应的加速器地址了,每个人都有自己的加速器地址

(5)配置镜像加速

[root@localhost ~]# cd /etc/docker/  ##如果没有该目录,需手动创建
[root@localhost docker]# ls
key.json
[root@localhost docker]# tee /etc/docker/daemon.json <<-'eof'  ##配置镜像加速
> {
>  "registry-mirrors": ["https://******.******.aliyuncs.com"]
> }
> eof
{
 "registry-mirrors": ["https://******.*******.aliyuncs.com"]
}
[root@localhost docker]# ls
daemon.json key.json
[root@localhost docker]# systemctl daemon-reload  ##重载守护进程
[root@localhost docker]# systemctl restart docker  ##重启docker
[root@localhost docker]#

7、开启系统的数据包转发功能

[root@localhost docker]# echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
[root@localhost docker]# sysctl -p  ##加载配置
net.ipv4.ip_forward = 1
[root@localhost docker]#

感谢各位的阅读,以上就是“CentOS7怎么部署19版的docker”的内容了,经过本文的学习后,相信大家对CentOS7怎么部署19版的docker这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是创新互联,小编将为大家推送更多相关知识点的文章,欢迎关注!


本文名称:CentOS7怎么部署19版的docker
网站URL:http://cqcxhl.com/article/jsooed.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP