CentOS/Ubuntu安装docker
2017-12-26 00:00
190 查看
Docker支持以下的CentOS版本:
CentOS 7 (64-bit)
CentOS 6.5 (64-bit) 或更高的版本
建议:
Docker 运行在 CentOS 7 上,要求系统为64位、系统内核版本为 3.10 以上。
Docker 运行在 CentOS-6.5 或更高的版本的 CentOS 上,要求系统为64位、系统内核版本为 2.6.32-431 或者更高版本。
3.10.0-514.26.2.el7.x86_64
最后输出这些即是安装完成
CentOS 7 (64-bit)
CentOS 6.5 (64-bit) 或更高的版本
建议:
Docker 运行在 CentOS 7 上,要求系统为64位、系统内核版本为 3.10 以上。
Docker 运行在 CentOS-6.5 或更高的版本的 CentOS 上,要求系统为64位、系统内核版本为 2.6.32-431 或者更高版本。
查看内核版本:
[root@test ~]# uname -r
3.10.0-514.26.2.el7.x86_64
安装Docker:
[root@test ~]# yum -y install docker
最后输出这些即是安装完成
Installed: docker.x86_64 2:1.12.6-68.gitec8512b.el7.centos Dependency Installed: container-selinux.noarch 2:2.33-1.git86f33cd.el7 container-storage-setup.noarch 0:0.8.0-3.git1d27ecf.el7 docker-client.x86_64 2:1.12.6-68.gitec8512b.el7.centos docker-common.x86_64 2:1.12.6-68.gitec8512b.el7.centos oci-register-machine.x86_64 1:0-3.13.gitcd1e331.el7 oci-systemd-hook.x86_64 1:0.1.14-1.git1ba44c6.el7 oci-umount.x86_64 2:2.3.0-1.git51e7c50.el7 skopeo-containers.x86_64 1:0.1.26-2.dev.git2e8377a.el7.centos Complete!
启动Docker后台服务
[root@test ~]# service docker start Redirecting to /bin/systemctl start docker.service
测试运行helloworld
[root@test ~]# 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 ca4f61b1923c: Pull complete Digest: sha256:4a8b4aa0b2d025dd6aad41d36e5d45b2fee996f27fe49dd130d9afefe7a8f7cd Hello 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 bash Share images, automate workflows, and more with a free Docker ID: https://cloud.docker.com/ For more examples and ideas, visit: https://docs.docker.com/engine/userguide/[/code] 由于本地没有hello-world这个镜像,所以会下载一个hello-world的镜像,并在容器内运行。使用脚本安装 Docker
1、使用 sudo 或 root 权限登录 Centos。
2、确保 yum 包更新到最新。
$ sudo yum update
3、执行 Docker 安装脚本。
$ curl -fsSL https://get.docker.com/ | sh
执行这个脚本会添加 docker.repo 源并安装 Docker。
4、启动 Docker 进程。
$ sudo service docker start
5、验证 docker 是否安装成功并在容器中执行一个测试的镜像。
$ sudo docker run hello-world
CentOS 系统的Docker安装完成
Ubuntu安装dockerwget -qO- https://get.docker.com/ | sh
相关文章推荐
- Docker Ubuntu容器安装ping
- Docker 使用ubuntu容器时,安装包包错:invoke-rc.d: policy-rc.d denied execution of start
- ubuntu 16.04 docker 安装
- ubuntu14.04中离线安装docker
- ubuntu14.04下docker安装方法
- Docker学习笔记:Docker安装(Ubuntu和CentOS系统)
- Ubuntu16.04.3安装Docker,配置镜像加速器及其基本使用
- Ubuntu 16.04安装使用Docker - mickjoust 的 技术小屋 - 博客频道 - CSDN.NET
- Ubuntu14.04安装docker
- ubuntu docker-compose安装[最快安装方法]
- 在Ubuntu 14.04安装和使用Docker
- Ubuntu16.04安装Docker1.12+开发实例+hello world+web应用容器
- 【docker】-- Ubuntu14.04 安装
- ubuntu下安装Docker
- 在Ubuntu Trusty 14.04 (LTS) (64-bit)安装Docker
- Ubuntu 16.04安装Docker
- ubuntu14.04利用aliyun安装docker
- Ubuntu 16.04安装Docker-Compose
- ubuntu16.04安装docker
- ubuntu14.04,安装docker(源代码管理工具)