在RedHat/CentOS下安裝Docker(不升級核心)

來源:互聯網
上載者:User

標籤:

背景

由於核心版本問題,最初僅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(不升級核心)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.