由于内核版本问题,最初仅Ubuntu可以较好的支持Docker。不过,由于RedHat系列OS(REHL、CentOS)是目前主流的Linux服务器操作系统,所以令RedHat系列OS支持Docker很有必要。目前Docker和RedHat已经展开深入合作,并在2013年年底推出了可以在RedHat系列OS上运行的Docker0.7。

目前有一些博客介绍了如何在CentOS上安装Docker,例如http://www.linuxidc.com/Linux/2014-01/95512.htm 。但是这些博客都是针对老版本的Docker,安装方法是在升级操作系统内核版本的基础上完成。问题是,我们不可以随意升级生产环境的操作系统内核版本, 而且Docker0.7的主旨就是:Docker使用者可以在不升级内核的前提下,在RedHat环境这使用Docker。因此,这里撰写一篇博客,介绍 如何在RedHat/CentOS环境下,安装新版本的Docker。

一、禁用selinux
由于Selinux和LXC有冲突,所以需要禁用selinux。编辑/etc/selinux/config,设置两个关键变量。   
SELINUX=disabled
SELINUXTYPE=targeted

二、配置Fedora EPEL源
1 sudo yum install http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm

三、添加hop5.repo源

cd /etc/yum.repos.d
sudo wget http://www.hop5.in/yum/el6/hop5.repo

四、安装Docker
sudo yum install docker-io

图1是yum安装过程中的截图,可以发现安装的软件只有docker和lxc相关包,没有内核包,例如kernel-ml-aufs。

图1 yum install docker-io输出截图

五、初步验证docker
  输入docker -h,如果有如下输出,就证明docker在形式上已经安装成功。

# docker -h
Usage of docker:
  -D=false: Enable debug mode
  -H=[]: Multiple tcp://host:port or unix://path/to/socket to bind in daemon mode, single connection otherwise
  -api-enable-cors=false: Enable CORS headers in the remote API
  -b="": Attach containers to a pre-existing network bridge; use 'none' to disable container networking
  -bip="": Use this CIDR notation address for the network bridge's IP, not compatible with -b
  -d=false: Enable daemon mode
  -dns=[]: Force docker to use specific DNS servers
  -g="/var/lib/docker": Path to use as the root of the docker runtime
  -icc=true: Enable inter-container communication
  -ip="0.0.0.0": Default IP address to use when binding container ports
  -iptables=true: Disable docker's addition of iptables rules
  -p="/var/run/docker.pid": Path to use for daemon PID file
  -r=true: Restart previously running containers
  -s="": Force the docker runtime to use a specific storage driver
  -v=false: Print version information and quit

Docker 的详细介绍请点这里
Docker 的下载地址请点这里

开源项目Docker,Red Hat新的虚拟化选择 http://www.linuxidc.com/Linux/2013-10/91051.htm

dockerlite: 轻量级 Linux 虚拟化 http://www.linuxidc.com/Linux/2013-07/87093.htm

Docker的搭建Gitlab CI 全过程详解 http://www.linuxidc.com/Linux/2013-12/93537.htm

Docker 和一个正常的虚拟机有何区别? http://www.linuxidc.com/Linux/2013-12/93740.htm

Docker 将改变所有事情 http://www.linuxidc.com/Linux/2013-12/93998.htm

在RedHat/CentOS下安装Docker(不升级内核)的更多相关文章

  1. docker学习之路-centos下安装docker

    前言 我要在云服务器上做一个asp.net core的webapi应用,使用docker来部署应用,中间用到的任何组件包括nginx和sqlserver 2017都是用docker来装载运行,所以,这 ...

  2. Centos下安装Docker,并配置国内docker源

    Centos下安装Docker 替换为国内的yum源(可选): mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.re ...

  3. CentOS下安装Docker CE教程

    一.安装前准备 1.硬件要求 CentOS 7(64-bit),内核版本不能低于3.10: CentOS 6.5(64-bit或更新的版本),内核版本为 2.6.32-431 或者更高版本,一般不建议 ...

  4. Linux 64位 CentOS下安装 Docker 容器,启动、停止

    一.Docker简介 Docker 提供了一个可以运行你的应用程序的封套(envelope),或者说容器,是轻量级的“容器引擎+映像仓库”,在LXC(linux轻量级容器)的基础上构建,可以运行任何应 ...

  5. Linux(CentOS)下安装docker

    Linux(CentOS)安装Docker 查看当前内核版本 [docker@localhost ~]$ uname -r 确保yum包更新到最新 [docker@localhost ~]$ sudo ...

  6. CentOS下安装Docker

    简介:本篇文章介绍如何在CentOS系统下面安装docker系统. 官方文档:https://docs.docker.com/install/linux/docker-ce/centos/ Docke ...

  7. 1. centos下安装docker

    CentOS Docker 安装 Docker支持以下的CentOS版本: CentOS 7 (64-bit) CentOS 6.5 (64-bit) 或更高的版本 前提条件 目前,CentOS 仅发 ...

  8. centos下安装docker最新版教程

    1.通过yum安装需要root或者能sudo的权限 yum包更新到最新$ sudo yum update 添加Docker yum源$ sudo tee /etc/yum.repos.d/docker ...

  9. linux centos下安装docker

    1.在vm中装好好centos后,更新内核 运行docker需要内核版本为3.8或者更高的版本,内核必须支持一种合适的存储驱动(Drivice Mapper.AUFS.vfs.btrfs.ZFS),默 ...

随机推荐

  1. iOS 电话在后台运行时,我的启动图片被压缩

    一,经历 <1> 第一感觉是启动图片没有设置好,长度设置小了.但是和网上说的正确方式相比,没什么差别. <2> 害怕是控制器影响的,又新建了一个项目,来检验启动图片是否设置成功 ...

  2. 通过串口设备vid,pid自动获得该设备所对应的串口号

    用C#做串口通讯很方便,因为dotfx2.0已经集成了Serial Port控件,此控件使用上比MSComm控件更简单,当然它也有一个小bug (RecievedBytesThreshold设置有时候 ...

  3. java使用poi读取ppt文件和poi读取excel、word示例

    java使用poi读取ppt文件和poi读取excel.word示例 http://www.jb51.net/article/48092.htm

  4. nginx基于IP的虚拟主机

    知识点: server的语法: upstream语法: upstream中192.168.100.1不是ip只是个标识,只要和下面的proxy_pass 对应即可. 基于IP的虚拟主机: listen ...

  5. iBatis in 语句参数传入方法

    刚刚开始在工作中用到iBatis 在用到in去查询或者删除 我本来是传递一个String的参数,但是总是报以下的错误

  6. HTML元素事件说明

    blur( ) 元素失去焦点 a, input, textarea, button, select, label, map, area change( ) 用户改变域的内容 input, textar ...

  7. Intent实现Activity组件之间的通信

    今天讲解的是使用Intent实现Activity组件之间的通信. 一.         使用Intent显式启动Activity,Activity1àActivity2 1.             ...

  8. 导出excel时,以form方式提交json数据

    今天在写项目时写到一个excel的导出,开始想用ajax请求后台后导出,但发现ajax会有返回值,而且ajax无法直接输出文件,而后台的excel导出方法已经封装好,不方便修改. 就改用了提交的方式f ...

  9. Transform a BST to greater sum tree

    Given a BST, transform it into greater sum tree where each node contains sum of all nodes greater th ...

  10. 一次与iptables有关的Openstack排错

    先说下环境: 宿主机A(192.168.1.242)上运行着实例a(192.168.1.176), 宿主机B(192.168.1.56)上运行着实例b(192.168.1.50). 用户说从实例b上t ...