centos7 docker安装

说明
系统:CentOS7.3
内核:3.10

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

1.下载

[root@localhost ~]# curl -O -sSL https://get.docker.com/rpm/1.7.0/centos-6/RPMS/x86_64/docker-engine-1.7.0-1.el6.x86_64.rpm
[root@localhost ~]# ls
anaconda-ks.cfg                       kibana-5.3.1-linux-x86_64.tar.gz
docker-engine-1.7.0-1.el6.x86_64.rpm  nginx-1.8.1
elasticsearch-5.3.1.zip               nginx-1.8.1.tar.gz
initial-setup-ks.cfg                  packetbeat-5.3.1-linux-x86_64.tar.gz

2.安装

[root@localhost ~]# yum localinstall --nogpgcheck docker-engine-1.7.0-1.el6.x86_64.rpm
[root@localhost ~]# docker -v
Docker version 1.7.0, build 0baf609

3.启动

[root@localhost ~]#  service docker start
Starting docker (via systemctl):                           [  OK  ]
[root@localhost ~]#  service docker status
● docker.service - LSB: start and stop docker
   Loaded: loaded (/etc/rc.d/init.d/docker; bad; vendor preset: disabled)
   Active: active (running) since Sun 2017-05-21 13:43:58 CST; 10s ago
......

4.通过在容器中运行docker镜像来验证docker是否正确安装

[root@localhost ~]# docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from hello-world
50a54e1f9180: Pull complete 
7a5a2d73abce: Pull complete 
......

参考链接:https://docs.docker.com/v1.7/docker/installation/centos/

posted @ 2017-05-21 13:55  fanren224  阅读(98)  评论(0编辑  收藏  举报