腾讯云 CentOS 安装Docker 1.13.1

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xinglu31/article/details/85016649

CentOS安装Docker

1. 使用yum列出docker: yum install docker

[root@VM_0_10_centos ~]# sudo yum update
Loaded plugins: fastestmirror, langpacks
epel                                                                                                                                                                          | 3.2 kB
extras                                                                                                                                                                        | 3.4 kB
os                                                                                                                                                                            | 3.6 kB
updates                                                                                                                                                                       | 3.4 kB
(1/7): epel/7/x86_64/group_gz                                                                                                                                                 |  88 kB
Complete!
[root@VM_0_10_centos ~]# yum list docker
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Available Packages
docker.x86_64                                                                        2:1.13.1-88.git07f3374.el7.centos
[root@VM_0_10_centos ~]# yum list docker-ce
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Error: No matching Packages to list

2. 使用yum安装docker:yum install docker

[root@VM_0_10_centos ~]# yum install docker
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
Complete!

3. 安装成功后查看docker版本:docker version

[root@VM_0_10_centos ~]# docker --version
Docker version 1.13.1, build 07f3374/1.13.1
[root@VM_0_10_centos ~]# docker version
Client:
Version:         1.13.1
API version:     1.26
Package version:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

4. 运行HelloWorld: docker run hello-world

[root@VM_0_10_centos ~]# docker run hello-world
/usr/bin/docker-current: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See '/usr/bin/docker-current run --help'.
## 5. 重新启动docker,解决“Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?”: service docker start
[root@VM_0_10_centos ~]# service docker start
Redirecting to /bin/systemctl start docker.service  

5. 之后可以顺利运行hello-world

[root@VM_0_10_centos ~]# docker run hello-world
Unable to find image 'hello-world:latest' locally
Trying to pull repository docker.io/library/hello-world ...
latest: Pulling from docker.io/library/hello-world
d1725b59e92d: Pull complete

没有更多推荐了,返回首页