第一步:yum install -y epel-release
第二步:yum install -y docker-io
如果第二步报错
那是因为被墙了
用如下命令:
yum install https://get.docker.com/rpm/1.7.1/centos-6/RPMS/x86_64/docker-engine-1.7.1-1.el6.x86_64.rpm
其他系统对应的源如下:
Ubuntu/Debian: curl -sSL https://get.docker.com | sh
Linux 64bit binary: https://get.docker.com/builds/Linux/x86_64/docker-1.7.1
Darwin/OSX 64bit client binary: https://get.docker.com/builds/Darwin/x86_64/docker-1.7.1
Darwin/OSX 32bit client binary: https://get.docker.com/builds/Darwin/i386/docker-1.7.1
Linux 64bit tgz: https://get.docker.com/builds/Linux/x86_64/docker-1.7.1.tgz
Windows 64bit client binary: https://get.docker.com/builds/Windows/x86_64/docker-1.7.1.exe
Windows 32bit client binary: https://get.docker.com/builds/Windows/i386/docker-1.7.1.exe
Centos 6/RHEL 6: https://get.docker.com/rpm/1.7.1/centos-6/RPMS/x86_64/docker-engine-1.7.1-1.el6.x86_64.rpm
Centos 7/RHEL 7: https://get.docker.com/rpm/1.7.1/centos-7/RPMS/x86_64/docker-engine-1.7.1-1.el7.centos.x86_64.rpm
Fedora 20: https://get.docker.com/rpm/1.7.1/fedora-20/RPMS/x86_64/docker-engine-1.7.1-1.fc20.x86_64.rpm
Fedora 21: https://get.docker.com/rpm/1.7.1/fedora-21/RPMS/x86_64/docker-engine-1.7.1-1.fc21.x86_64.rpm
Fedora 22: https://get.docker.com/rpm/1.7.1/fedora-22/RPMS/x86_64/docker-engine-1.7.1-1.fc22.x86_64.rpm
第三步:配置阿里云镜像
/etc/sysconfig/docker下
other_args="--registry-mirror=https://en4452z0.mirror.aliyuncs.com"