Centos 安装 docker

Centos 7 安装

脚本安装

  • 执行Docker安装脚本
curl -sSL https://get.docker.com/ | sh  
yum install -y docker-selinux  
  • 启动Docker
systemctl start docker.service  
  • 验证docker已经正常安装
docker run hello-world  

基本要求

  • centos6.5及以后版本(64位)
  • 安装epel库

添加yum源

  • 方式一
yum install http://mirrors.yun-idc.com/epel/6/i386/epel-release-6-8.noarch.rpm  
yum install docker-io  
yum upgrade device-mapper-libs  
  • 方式二
rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm  
yum install docker-io  

查看版本号

#docker version
Client version: 1.7.1  
Client API version: 1.19  
Go version (client): go1.4.2  
Git commit (client): 786b29d/1.7.1  
OS/Arch (client): linux/amd64