centos6.7安装docker

如今的docker官网上面,安装docker社区版本已经要求CentOS版本到了7以上,Cent6.7安装会出现如下问题:

[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.32-573.el6.x86_64 #1 SMP Thu Jul 23 15:44:03 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@localhost ~]# cat /etc/redhat-release
CentOS release 6.7 (Final)
[root@localhost ~]# docker
-bash: docker: command not found
[root@localhost ~]# yum install docker
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
base | 3.7 kB 00:00
base/primary_db | 4.6 MB 00:08
extras | 3.4 kB 00:00
extras/primary_db | 37 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 5.2 MB 00:55
No package docker available.
Error: Nothing to do
[root@localhost ~]# yum install docker-io
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Determining fastest mirrors
* base: mirrors.zju.edu.cn
* extras: mirrors.skyshe.cn
* updates: mirrors.zju.edu.cn
No package docker-io available.
Error: Nothing to do

可以看到,在Centos6.7的标准yum源中已经没有Docker的安装包了。

那么CentOS6.7该如何安装呢?

这时,我们需要安装EPEL。

  注:EPEL(Extra Packages for Enterprise Linux),企业版Linux额外包,RHEL分布非标准包的社区类库。

安装如下:

yum install -y epel-release
 接下来安装Docker1.7.1,在1.7.1中,安装包名称为docker-io,故我们的安装命令如下:

yum install docker-io
查看docker版本:

[root@server10 centos7]# docker -v
Docker version 1.7.1, build 786b29d/1.7.1

启动docker
[root@localhost ~]# /etc/init.d/docker start
Starting cgconfig service:                                 [确定]
Starting docker:                                           [确定]
[root@localhost ~]# ps aux |grep docker
root      3176  1.7  0.6 222296 12268 pts/0    Sl   08:56   0:00 /usr/bin/docker -d
root      3308  0.0  0.0 103320   912 pts/0    S+   08:56   0:00 grep docker

你可能感兴趣的:(docker)