由于docker要求centos内核不低于3.8,本博客中所有docker的安装都是基于centos7
方法一:添加docker的yum源
1
2
3
4
5
6
7
|
#vim /etc/yum.repos.d/docker.repo
[dockerrepo]
name=Docker Repository
baseurl=https:
//yum
.dockerproject.org
/repo/main/centos/7/
enabled=1
gpgcheck=1
gpgkey=https:
//yum
.dockerproject.org
/gpg
|
安装docker:
#yum install docker-engine
设置开机启动:
#systemctl enable docker.service
启动docker:
#systemctl start docker
测试docker:
#docker run --rm hello-world
方法二:用阿里云的安装脚本
1
|
curl -sSL http:
//acs-public-mirror
.oss-cn-hangzhou.aliyuncs.com
/docker-engine/internet
| sh -
|
方法三:用rancher的安装脚本
http://docs.rancher.com/rancher/v1.6/en/hosts/#supported-docker-versions
打开上面连接,选择对应的安装脚本
1.10:curl https://releases.rancher.com/install-docker/1.10.sh | sh
1.11:curl https://releases.rancher.com/install-docker/1.11.sh | sh
1.12.3(或更高):curl https://releases.rancher.com/install-docker/1.12.sh | sh
1.13:curl https://releases.rancher.com/install-docker/1.13.sh | sh
17.03.x-ce:curl https://releases.rancher.com/install-docker/17.03.sh | sh 本文转自激情燃烧的岁月博客51CTO博客,原文链接http://blog.51cto.com/liuzhengwei521/1895895如需转载请自行联系原作者 weilovepan520