在CentOS 7上安装Docker环境
官网文档:https://docs.docker.com/engine/installation/linux/centos/ ,本文大部分是照搬官方文档写的,如果你英文还不错,那么就直接移步官方文档吧,如果你英文实在是不行,那就勉强看一下本人这生涩的翻译~
以下操作均在root用户下完成
1.配置yum软件库
为保证安装的成功,首先使用yum update更新Yum包,表示我的好多yum包都需要更新,1500+的包,如果你像我一样好久没有更新过,那就耐心等候吧。
然后在yum软件库中新增docker的配置:
# tee /etc/yum.repos.d/docker.repo <<-'EOF'
[dockerrepo]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/main/centos/7/
enabled=
gpgcheck=
gpgkey=https://yum.dockerproject.org/gpg
EOF
2.安装Docker
有了yum软件库的配置之后,安装也变得异常的简单,只需要以下一句即可:
# yum install docker-engine
3.启动Docker
一切就绪之后,使用start命令来启动Docker守护进程:
# service docker start
4.输出hello-world
程序员貌似跟hello-world有仇,有事儿没事就打印人家一下,玩docker咱们当前也不例外,先来个hello-world吧,这里的基本原理是利用人家已经写好的hello-world镜像,下载到本地,然后把他运行起来~
使用以下命令:
# docker run hello-world
然后控制端会输出类似于如下的信息,就证明我们的docker环境安装成功了~
在这里,我第一次失败了~显示:
Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/library/hello-world/manifests/latest: Get https://auth.docker.io/token?scope=repository%3Alibrary%2Fhello-world%3Apull&service=registry.docker.io: net/http: TLS handshake timeout.
See 'docker run --help'.
然后我又来了一次就好了,应该是墙的原因吧,看着是网络访问失败了~
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c04b14da8d14: Pull complete
Digest: sha256:0256e8a36e2070f7bf2d0b0763dbabdd67798512411de4cdcf9431a1feb60fd9
Status: Downloaded newer image for hello-world:latest Hello from Docker!
This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps:
. The Docker client contacted the Docker daemon.
. The Docker daemon pulled the "hello-world" image from the Docker Hub.
. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
. 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 Hub account:
https://hub.docker.com For more examples and ideas, visit:
https://docs.docker.com/engine/userguide/
在CentOS 7上安装Docker环境的更多相关文章
- 在Centos 7上安装Docker
在Centos 7上安装Docker 1.docker介绍 docker是类似于vmware的虚拟化软件,可以开发.容纳.运行应用程序的平台,在容器中安全的隔离运行应用程序. 2.Docker引擎 D ...
- Install Docker Engine on CentOS 在CentOS 7 上安装Docker
Install Docker Engine on CentOS OS Requirements 系统要求 To install Docker Engine,you need a maintained ...
- CentOS 7上搭建Docker环境
一.Docker介绍和安装 http://linux.cn/article-4340-1.html Docker 是一个开源工具,它可以让创建和管理 Linux 容器变得简单.容器就像是轻量级的虚拟机 ...
- 如何在 CentOS 7 上安装 Docker
Docker 是一个开源工具,它可以让创建和管理 Linux 容器变得简单.容器就像是轻量级的虚拟机,并且可以以毫秒级的速度来启动或停止.Docker 帮助系统管理员和程序员在容器中开发应用程序,并且 ...
- 【docker】linux系统centOS 7上安装docker
要求: 一个centOS 7系统 虚拟就上安装CentOS 7步骤 本文操作在本机上使用xshell连接虚拟机上的centOS 7进行操作 1.Docker 要求 CentOS 系统的内核版本高于 ...
- CentOS 7上安装Docker 1.8
Docker支持运行在以下CentOS版本: CentOS 7.X 安装在二进制兼容的EL7版本如 Scientific Linux也是可能成功的,但是Docker没有测试过并且不官方支持. 此文带你 ...
- CentOS 7上安装Docker
目录 安装步骤 1.查看Docker的版本 2.安装 Docker 3.启动Docker 4.设置为开启启动 5.查看Docker安装信息 6.使用Docker 中国加速器 安装步骤 安装操作系统 ...
- 在centos linux上安装docker
前置条件 64-bit 系统 kernel 3.10+ 1.检查内核版本,返回的值大于3.10即可. $ uname -r 2.确保yum是最新的 $ yum update 3.安装 Docker y ...
- 在CentOS 7上搭建Docker环境
Preface We commonly use VMware or VirtualBox to install our Virtual Machines before.For the ...
随机推荐
- unity3d之相机跟随人物
一.第三人称视角 _1 先设置好相机与玩家之间的角度 给相机添加代码 using UnityEngine; using System.Collections; namespace CompletePr ...
- C# javascript 全选按钮
function selectAll(checkbox) { $('input[type=checkbox]').attr('checked', $(checkbox ...
- 【Immutable】拷贝与JSON.parse(JSON.stringify()),深度比较相等与underscore.isEqual(),性能比较
样本:1MB的JSON文件,引入后生成500份的一个数组: 结果如下: 拷贝性能: JSON.parse(JSON.stringify()) 的方法:2523.55517578125ms immuta ...
- sql: Compare Tables
---使用 UNION.INTERSECT 或 EXCEPT 运算符合并的所有查询必须在其目标列表中有相同数目的表达式 select * from BookInfoList --存在不同的 selec ...
- mysql索引是什么?索引结构和使用详解
索引是什么 mysql索引: 是一种帮助mysql高效的获取数据的数据结构,这些数据结构以某种方式引用数据,这种结构就是索引.可简单理解为排好序的快速查找数据结构.如果要查“mysql”这个单词,我们 ...
- canvas image array(canvas图片阵列)
code: <!DOCTYPE html> <html> <head> <title>hehe</title> </head& ...
- DB DBS 和DBMS区别
DB:是指datebase(数据库) DBS:是指datebase systerm (数据库系统) DBMS:是指datebase mangement systerm(数据库管理系统)区别:数据库 ...
- ArcSDE10.2.2使用SQL操作ST_Geometry时报ORA-28579或ORA-20006错误
ArcSDE10.2.2使用SQL操作ST_Geometry时报ORA-28579或ORA-20006错误 1.测试环境说明 ArcSDE版本:10.2.2 Oracle版本:12.1.0.1和11. ...
- Android MediaPlayer播放音乐并实现进度条
提前工作,往sd卡里放音乐文件 1.布局文件main.xml <?xml version="1.0" encoding="utf-8"?> < ...
- J2EE项目工具集(转)
1.支持重构,TDD, Debug J2EE应用和Flying Error提示的IDE a.重构:即使团队用的最多的只是Rename,Move,Extract Method等有限几个最基本的功能,但J ...