在RedHat/CentOS下安装Docker(不升级内核)
背景
由于内核版本问题,最初仅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

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
openStack openSource CloudComputing
<一,> ,OpenStack a few Core Compontents integration with openStack-keystone Identity service1.1,user-createkeystone user-create --name --pass --email1.2,tenant-createkeystone tenant-create --name (remainers tips, public use service tenant)1.3,role-createkeystone 1.4,[link user,tenant,role]keystone user-role-add --user --tenant --role1.5,create core components servicekeystone service-create --name --type --description ""1.6,create openStack core components service endpointseg,neutron network...
- 下一篇
Docker介绍(一)
在TES GLOBAL,我们已经爱上Docker并从Docker的0.8版本开始就在生产环境中使用它。我们的很多开发者都参加了在DockerCon欧洲上的培训。下面是我们总结的一些tips,希望可以帮到已经有Docker基础的同学。 1. CLI 1.1 美化docker ps的输出 将Docker ps的输出通过管道到less -S,这样表格式的行就不会被折叠。 docker ps-a|less-S 1.2 刷新日志 docker的日志不会即时刷新,除非你使用了-F选项: docker logs<containerid>-F 1.3 从docker inspect中获取一个单一的值 docker inspect默认会输出大量的JSON格式的数据。你可以用jq,来得到某一特定键的值。或者你可以使用内置的go模板功能: 最后一个docker容器现在运转正常吗? docker inspect--format'{{.State.Running}}'$(docker ps-lq) 1.4 使用docker exec而不是sshd 或者 nsenter 如果你查看过Docke...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- CentOS7编译安装Gcc9.2.0,解决mysql等软件编译问题
- SpringBoot2配置默认Tomcat设置,开启更多高级功能
- SpringBoot2整合Redis,开启缓存,提高访问速度
- Windows10,CentOS7,CentOS8安装Nodejs环境
- MySQL8.0.19开启GTID主从同步CentOS8
- Docker快速安装Oracle11G,搭建oracle11g学习环境
- SpringBoot2整合MyBatis,连接MySql数据库做增删改查操作
- Hadoop3单机部署,实现最简伪集群
- Eclipse初始化配置,告别卡顿、闪退、编译时间过长
- 设置Eclipse缩进为4个空格,增强代码规范