首页 > 其他 > 详细

Docker CE 全自动安装

时间:2018-02-27 10:50:55      阅读:218      评论:0      收藏:0      [点我收藏+]
操作系统

[root@localhost ~]# cat /etc/redhat-release 
CentOS Linux release 7.3.1611 (Core) 
[root@localhost ~]# uname -r
3.10.0-514.el7.x86_64

安装代码如下所示:

#!/bin/bash
#2018-2-26 15:34:05
#auto install docker-ce on CentOS 7
#by author dengaosky
######################
#Uninstall old versions
yum remove -y docker docker-common docker-selinux docker-engine
#Install using the repository
yum install -y yum-utils device-mapper-persistent-data lvm2
##yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
#Disable the edge and test repositories
yum-config-manager --disable docker-ce-edge
yum-config-manager --disable docker-ce-test
#INSTALL DOCKER CE
yum install docker-ce -y
#Config docker
cat >/etc/docker/daemon.json <<EOF
{"registry-mirrors": ["http://df98fb04.m.daocloud.io"]}
EOF
#Disable Firewalld,Install and Enable iptables
systemctl disable firewalld;systemctl stop firewalld
yum install iptables-services -y
systemctl enable iptables;systemctl restart iptables
#Disable Selinux
setenforce 0
sed -i '/SELINUX/s/enforcing/disabled/g' /etc/selinux/config
#Start Docker
systemctl start docker
systemctl enable docker


Docker CE 全自动安装

原文:http://blog.51cto.com/dengaosky/2073347

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