03 - Centos7中安装及验证Docker
来源:互联网 发布:单纯的js做动态网站 编辑:程序博客网 时间:2024/06/16 08:19
安装
在Centos7中安装Docker非常简单,只需要一个命令:
yum -y install docker
而在Centos6的系统中安装Docker要相对复杂一些,首先需要将系统内核版本升级到3.10
以上,其次需要通过使用命令yum update
等升级操作系统,具体安装方法可参考文章《Centos 6.4中安装Docker》。
安装完成后需要启动docker服务:
systemctl start docker
验证
安装完成后需要验证docker服务是否安装成功和是否正常启动。
- 验证版本信息
docker version
出现下面信息表示docker安装成功及正常启动:
[root@localhost ~]# docker versionClient: Version: 1.10.3 API version: 1.22 Package version: docker-common-1.10.3-46.el7.centos.14.x86_64 Go version: go1.6.3 Git commit: cb079f6-unsupported Built: Fri Sep 16 13:24:25 2016 OS/Arch: linux/amd64Server: Version: 1.10.3 API version: 1.22 Package version: docker-common-1.10.3-46.el7.centos.14.x86_64 Go version: go1.6.3 Git commit: cb079f6-unsupported Built: Fri Sep 16 13:24:25 2016 OS/Arch: linux/amd64[root@localhost ~]#
如果出现下面信息则表示只是安装成功而没有正常启动:
[root@localhost ~]# docker versionClient: Version: 1.10.3 API version: 1.22 Package version: docker-common-1.10.3-46.el7.centos.14.x86_64 Go version: go1.6.3 Git commit: cb079f6-unsupported Built: Fri Sep 16 13:24:25 2016 OS/Arch: linux/amd64Cannot connect to the Docker daemon. Is the docker daemon running on this host?
此时需要输入命令:systemctl start docker
来启动docker服务。
- 启动容器验证
输入命令:docker run hello-world
:
[root@localhost ~]# docker run hello-worldUnable to find image 'hello-world:latest' locallyTrying to pull repository docker.io/library/hello-world ...latest: Pulling from docker.io/library/hello-worldc04b14da8d14: Pull completeDigest: sha256:0256e8a36e2070f7bf2d0b0763dbabdd67798512411de4cdcf9431a1feb60fd9Status: Downloaded newer image for docker.io/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. 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 Hub account: https://hub.docker.comFor more examples and ideas, visit: https://docs.docker.com/engine/userguide/
出现上面信息表示安装成功!
0 0
- 03 - Centos7中安装及验证Docker
- Centos7中安装docker
- CentOS7中安装Docker
- centos7中安装docker
- 04 - Windows8中安装及验证Docker
- centos7安装docker及docker常用命令
- 在centos7中安装docker
- centos7安装docker及私有仓库
- centos7 安装docker及搭建私有仓库
- docker中centos7安装ssh服务
- 阿里云CentOS7中安装Docker
- Centos7安装Docker
- CentOS7 安装 使用 Docker
- centos7安装docker
- docker centos7 安装ssh
- centos7安装docker
- Centos7 dvd 安装docker
- centos7安装docker最新版
- 实现从oss(阿里云)服务器以附件形式下载文件
- java GC 垃圾回收
- 用原生js实现复选框选择以及全选非全选功能 (待看)
- mosquitto 调试使用mqtt应用(mqtt调试助手)
- 02 - Centos7中安装Docker、虚拟机的网络配置
- 03 - Centos7中安装及验证Docker
- jQuery基础之表单验证
- select()函数以及FD_ZERO、FD_SET、FD_CLR、FD_ISSET
- Postman-进阶使用
- 猫哥带你去战斗——Java Web开发——前言[0]
- 拷贝加指针拷贝
- mac os下 ionic 2 安装(二),酷炫的hello world 先跑起来!!(运行app)
- 04 - Windows8中安装及验证Docker
- 第十四周项目2--二叉树排序树中查找的路径