1.使用官方推荐的方式安装 yum-utils
yum install -y yum-utils2.使用如下的命令设置稳定版的 repositoryyum-config-manager \ --add-repo \ https://docs.docker.com/engine/installation/linux/repo_files/centos/docker.repo出现错误Loaded plugins: fastestmirror, refresh-packagekit更改文件: 1.vim /etc/yum/pluginconf.d/fastestmirror.conf enabled=0 2. vim /etc/yum.conf plugins=0更新yum yum makecache fast3.创建文件 vim /etc/yum.repos.d/docker.repo输入以下内容 [dockerrepo]name=Docker Repositorybaseurl=https://yum.dockerproject.org/repo/main/centos/$releasever/enabled=1gpgcheck=1gpgkey=https://yum.dockerproject.org/gpg4.安装最新版本的dockeryum -y install docker-engine5.启动docker service docker start6.使用docker docker run hello-world可以使用service docker status查看状态发现错误Cannot connect to the Docker daemon at 。。。查看进程出现docker dead but pid file exists删除/var/run 下面的docker.xx文件均没用使用以下方法:yum-config-manager --enable public_ol6_latestyum install device-mapper-event-libs参考 http://stackoverflow.com/questions/27216473/docker-1-3-fails-to-start-on-rhel6-5正常启动显示docker (pid 2295) is running...测试docker
[root@localhost run]# docker run hello-world
Unable to find image 'hello-world:latest' locallylatest: Pulling from hello-world65b27d3bd74d: Pull complete 9f5834b25059: Pull complete Digest: sha256:fb158b7ad66f4d58aa66c4455858230cd2eab4cdf29b13e5c3628a6bfc2e9f05Status: Downloaded newer image for hello-world:latestHello from Docker!This message shows that your installation appears to be working correctly.To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bashShare images, automate workflows, and more with a free Docker ID: https://hub.docker.com/For more examples and ideas, visit:完成