以下是支持 Docker 的 RHEL 版本:
* [_Red Hat Enterprise Linux 7 (64-bit)_](https://github.com/widuu/chinese_docker/blob/master/installation/redhat.md#red-hat-enterprise-linux-7-installation)
* [_Red Hat Enterprise Linux 6.5 (64-bit)_](https://github.com/widuu/chinese_docker/blob/master/installation/redhat.md#red-hat-enterprise-linux-6.5-installation)?或更高版本
## 內核支持
如果你的 RHEL 運行的是發行版內核。那就僅支持通過?_extras_?渠道或者 EPEL 包來安裝 Docker。如果你打算在非發行版本的內核上運行 Docker ,內核的改動可能會導致出錯
## Red Hat Enterprise Linux 7 installation
**Red Hat Enterprise Linux 7 (64位)**?[自帶Docker](https://access.redhat.com/site/products/red-hat-enterprise-linux/docker-and-containers). 你可以在[發行日志](https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/7.0_Release_Notes/chap-Red_Hat_Enterprise_Linux-7.0_Release_Notes-Linux_Containers_with_Docker_Format.html)中找到概述和指南。
Docker 包含在?**extras**?鏡像源中,使用下面的方法可以安裝 Docker:
1. 啟用?**extras**?鏡像源:
~~~
$ sudo subscription-manager repos --enable=rhel-7-server-extras-rpms
~~~
2. 安裝 Docker :
~~~
$ sudo yum install docker
~~~
如果你是RHEL客戶,更多的 RHEL-7 安裝、配置和[用戶指南](https://access.redhat.com/site/articles/881893)可以在[客戶中心](https://access.redhat.com/)中找到。
請繼續閱讀?[啟動 Docker 進程?](https://github.com/widuu/chinese_docker/blob/master/installation/redhat.md#starting-the-docker-daemon).
## Red Hat Enterprise Linux 6.5 installation
你需要在?**64位**?的?[RHEL 6.5](https://access.redhat.com/site/articles/3078#RHEL6)?或更高的版本上來安裝 Docker,Docker 工作需要特定的內核補丁, 因此 RHEL 的內核版本應為 2.6.32-431 或者更高。
Docker 已經包含在 RHEL 的 EPEL 源中。該源是 Extra Packages for Enterprise Linux (EPEL) 的一個額外包,社區中正在努力創建和維護相關鏡像。
## 內核支持
如果你的 RHEL 運行的是發行版內核。那就僅支持通過?_extras_?渠道或者 EPEL 包來安裝 Docker。如果你打算在非發行版本的內核上運行 Docker ,內核的改動可能會導致出錯
> **Warning**: Please keep your system up to date using?`yum update`?and rebooting your system. Keeping your system updated ensures critical security vulnerabilities and severe bugs (such as those found in kernel 2.6.32) are fixed.
首先,你需要安裝EPEL鏡像源,請查看?[EPEL installation instructions](https://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F).
在EPEL中已經提供了?`docker-io`?包
如果你安裝了(不相關)的 Docker 包,它將與?`docker-io`?沖突。在安裝?`docker-io`?之前,請先卸載 Docker
下一步,我們將要在我們的主機中安裝 Docker,也就是?`docker-io`?包:
~~~
$ sudo yum -y install docker-io
~~~
更新`docker-io`包:
~~~
$ sudo yum -y update docker-io
~~~
現在 Docker 已經安裝好了,我們來啟動 docker 進程:
~~~
$ sudo service docker start
~~~
設置開機啟動:
~~~
$ sudo chkconfig docker on
~~~
現在,讓我們確認 Docker 是否正常工作:
~~~
$ sudo docker run -i -t fedora /bin/bash
~~~
繼續?[啟動 Docker 進程](https://github.com/widuu/chinese_docker/blob/master/installation/redhat.md#%E5%90%AF%E5%8A%A8Docker%E8%BF%9B%E7%A8%8B)
## 啟動 Docker 進程
現在 Docker 已經安裝好了,讓我們來啟動 Docker 進程
~~~
$ sudo service docker start
~~~
如果我們想要開機啟動 Docker ,我們需要執行如下的命令:
~~~
$ sudo chkconfig docker on
~~~
現在測試一下是否正常工作.
~~~
$ sudo docker run -i -t fedora /bin/bash
~~~
> 注意: 如果你運行的時候提示一個?`Cannot start container`?的錯誤,錯誤中提到了 SELINUX 或者 權限不足。你需要更新 SELINUX 規則。你可以使用?`sudo yum upgrade selinux-policy`?然后重啟。
## 自定義進程選項
如果你想要添加一個 HTTP 代理,為 Docker 運行文件設置不同的目錄或分區,又或者定制一些其它的功能,請閱讀我們的系統文章,了解[如何定制 Docker 進程](https://github.com/widuu/chinese_docker/blob/master/articles/systemd.md)
## 問題
遇到問題請到?[Red Hat Bugzilla for docker-io component](https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora%20EPEL&component=docker-io)?進行反饋。
- 關于Docker
- 鏡像簡介
- 安裝篇
- Mac OS X
- Ubuntu
- Red Hat Enterprise Linux
- CentOS
- Debain
- Gentoo
- Google Cloud Platform
- Rackspace Cloud
- Amazon EC2
- IBM Softlayer
- Arch Linux
- FrugalWare
- Fedora
- openSUSE
- CRUX Linux
- Microsoft Windows
- Binaries
- 用戶指南
- 使用Docker Hub
- 在Docker中運行應用
- 使用容器
- 使用docker鏡像
- 連接容器
- 管理容器數據
- 使用Docker Hub
- Docker Hub
- 賬戶
- 存儲庫
- 自動構建
- 官方案例
- Docker中運行MongoDB
- Docker中運行Redis服務
- Docker中運行PostgreSQL
- Docker中運行Riak服務
- Docker中運行SSH進程服務
- Docker中運行CouchDB服務
- Docker中運行Apt-Cacher-ng服務