使用yum命令即可安装

yum install docker

安装完成后,使用下面的命令来启动 docker 服务,并将其设置为开机启动:

[root@localhost ~]# systemctl start docker.service
[root@localhost ~]# systemctl enable docker.service

下载官方的 CentOS 镜像到本地 (由于 Docker 被墙 ,所以使用 http://docker.cn 的镜像)

[root@localhost ~]# docker pull centos
Pulling repository centos
192178b11d36:Download complete
70441cac1ed5:Download complete
ae0c2d0bdc10:Download complete
511136ea3c5a:Download complete
5b12ef8fd570:Download complete

确认 CentOS 镜像已经被获取:

[root@localhost ~]# docker images centos
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
centos centos5 192178b11d362 weeks ago 466.9 MB
centos centos6 70441cac1ed52 weeks ago 215.8 MB
centos centos7 ae0c2d0bdc10 2 weeks ago 224 MB
centos latest ae0c2d0bdc10 2 weeks ago 224 MB

运行一个 Docker 容器:

[root@localhost ~]# docker run –i –t centos /bin/bash
[root@dbf66395436d /]#
我们可以看到,CentOS 容器已经被启动,并且我们得到了 bash 提示符。在 docker 命令中我们使用了 “-i 捕获标准输入输出”和 “-t 分配一个终端或控制台”选项。若要断开与容器的连接,输入 exit。

[root@cd05639b3f5c /]# cat /etc/RedHat–release
CentOSLinux release 7.0.1406(Core)
[root@cd05639b3f5c /]#exit
exit
[root@localhost ~]#
我们还可以搜索基于 Fedora 和 Ubuntu 操作系统的容器。

[root@localhost ~]# docker search ubuntu
[root@localhost ~]# docker search fedora

显示当前正在运行容器的列表

docker ps

centos 7使用yum安装docker容器的更多相关文章

  1. CentOS 7使用yum安装Docker

    安装依赖 # 配置阿里云源 # 备份 cp /etc/yum.repos.d/CentOS-Base.repo{,.bak'_'`date +%Y%m%d_%H%M%S`} # 下载 wget -O ...

  2. CentOS7 下 yum 安装 Docker CE

    前言 Docker 使用越来越多,安装也很简单,本次记录一下基本的步骤. Docker 目前支持 CentOS 7 及以后的版本,内核要求至少为 3.10. Docker 官网有安装步骤,本文只是记录 ...

  3. centos安装docker容器

    centos安装docker容器 系统环境需求 docker要运行在centos7系统中,系统为64位机器上,内核最小版本在3.10以上 如果系统为centos6,后面有附带的安装方法 uname - ...

  4. 配置docker官方源并用yum安装docker

    一.docker的官方安装文档: https://docs.docker.com/engine/installation/linux/centos/ 由docker给的文档可以看出它也只是去配置了一个 ...

  5. 在centos和redhat上安装docker

    前置条件 64-bit 系统 kernel 3.10+一.检查内核版本,返回的值大于3.10即可 $ uname -r 二.使用 sudo 或 root 权限的用户登入终端 三.卸载旧版本(如果安装过 ...

  6. CentOS 7.3 上安装docker

    Docker,分为社区版CE和企业版EE.社区版是免费提供给个人开发者和小型团体使用的,企业版会提供额外的收费服务. 一.安装docker 1.Docker 要求 CentOS 系统的内核版本高于 3 ...

  7. CentOS下通过yum安装svn及配置

    CentOS下通过yum安装svn及配置 1.环境centos5.5 2.安装svnyum -y install subversion 3.配置 建立版本库目录mkdir /www/svndata s ...

  8. Linux CentOS 6.5 yum安装MongoDB的操作

    安装MongoDB的方法有很多种,可以源代码安装,在CentOS也可以用yum源安装的方法.由于MongoDB更新得比较快,我比较喜欢用yum源安装的方法.64位CentOS下的安装步骤如下: 1.准 ...

  9. CentOS 7 使用yum安装出现错误

    CentOS 7 使用yum安装软件出现错误: Loaded plugins: fastestmirror 此错误信息可能是因为DNS配置错误,可以通过更改配置文件来解决: 1. 使用vi打开DNS的 ...

随机推荐

  1. vue-awesome-swiper 的 使用

    1.确保 package.json文件中有  "vue-awesome-swiper": "^3.1.3",没有的话install下 2.在main.js配置 ...

  2. kafka producer参数详解

    https://my.oschina.net/u/218540/blog/1794669/

  3. PIE SDK彩色标准化融合

    1.算法功能简介 色彩标准化融合对彩色图像和高分辨率图像进行数学合成,从而使图像得到锐化.色彩归一化变换也被称为能量分离变换( Energy Subdivision Transform),它使用来自融 ...

  4. 后台返回的值ajax接收不到

    原因有很多种可能,我遇到的是后台写的Controller忘记了加@ResponseBody,导致springMVC把返回的字符串当成view了

  5. 爬虫beautifulsoup实践

    爬虫beautifulsoup实践: 目的:在https://unsplash.com/上爬取图片并保存到本地文件夹里.   一.观察response.首先,在Chrome浏览器里观察一下该网页的re ...

  6. es6 vs commonjs

    'use strict' export function showMe() { alert("es6"); }; class logging { constructor() { a ...

  7. 转:JAVA线程池ThreadPoolExecutor与阻塞队列BlockingQueue

    从Java5开始,Java提供了自己的线程池.每次只执行指定数量的线程,java.util.concurrent.ThreadPoolExecutor 就是这样的线程池.以下是我的学习过程. 首先是构 ...

  8. GIT远程仓库的使用

    查看当前项目有哪些远程仓库 $ git remote bixiaopeng@bixiaopengtekiMacBook-Pro wirelessqa$ git remote origin 查看远程仓库 ...

  9. BNU27935——我爱背单词——————【数组模拟】

    我爱背单词 Time Limit: 1000ms Memory Limit: 65536KB 64-bit integer IO format: %lld      Java class name:  ...

  10. spark scala 例子

    object ScalaApp { def main(args: Array[String]): Unit = { var conf = new SparkConf() conf.setMaster( ...