以下版本的 Debian 支持 Docker:
* [Debian 8.0 Jessie (64-bit)](https://github.com/widuu/chinese_docker/blob/master/installation/debian.md#debian-jessie-80-64-bit)
* [Debian 7.7 Wheezy (64-bit)](https://github.com/widuu/chinese_docker/blob/master/installation/debian.md#debian-wheezystable-7x-64-bit)
## Debian Jessie 8.0 (64-bit)Debian
Debian 8 使用的是 3.14.0 的內核版本,可以從 Debian 的鏡像源來安裝?`docker.io`?包。
> 提示:Debian 包含一個特別老的KDE3/GNOME2包叫?`docker`?,所以我們把這個包叫`docker.io`。
### 安裝
安裝最新版的 Debian 軟件包(可能不是最新版本 Docker )
~~~
$ sudo apt-get update
$ sudo apt-get install docker.io
~~~
驗證 Docker 是否正常工作 :
~~~
$ sudo docker run -i -t Ubuntu /bin/bash
~~~
該命令將下載?`Ubuntu`?鏡像,并且在容器內運行?`bash`.
> 注意:如果你打算啟用內存和交換空間設置,請查看[這里](https://github.com/widuu/chinese_docker/blob/master/installation/ubuntu.md)
## Debian Wheezy/Stable 7.x (64-bit)
安裝 Docker 需要內核在3.8版本以上,但是 Wheezy 的內核版本是 3.2([bug #407](https://github.com/docker/docker/issues/407%20kernel%20versions)對 Docker 需要3.8版本內核進行了討論。)
幸運的是,官方提供了?`wheezy-backports`?,它內核版本是3.16,可以支持 Docker。
### 安裝
1. 從 wheezy-backports 鏡像源來安裝內核
在?`/etc/apt/sources.list`?文件下添加如下內容:
~~~
deb http://http.debian.net/debian wheezy-backports main
~~~
安裝?`linux-image-amd64`?包 (注意使用?`-t wheezy-backports`)
~~~
$ sudo apt-get update
$ sudo apt-get install -t wheezy-backports linux-image-amd64
~~~
2. 從 get.docker.com 獲取安裝腳本并安裝:
~~~
curl -sSL https://get.docker.com/ | sh
~~~
### 使用非root
docker 進程通過監聽一個 Unix Socket 來替代 TCP 端口。在默認情況下,docker 的 Unix Socket屬于`root`用戶,當然其他用戶可以使用`sudo`方式來訪問。因為這個原因, docker 進程就一直是`root`用戶運行的。
如果你(或者說你安裝Docker的時候)創建一個叫?`docker`?的用戶組,并為用戶組添加用戶。這時候,當 Docker 進程啟動的時候,`docker`?用戶組對 Unix Socket 有了讀/寫權限。 你必須使用root用戶來運行 docker 進程,但你可以用?`docker`群組用戶來使用 docker 客戶端,你再使用 docker 命令的時候前邊就不需要加?`sudo`?了。從Docker 0.9版本開始,你可以使用`-G`來指定用戶組。
> 警告:Docker 用戶組(或者用?`-G`?指定的用戶組)有等同于root用戶的權限,有關系統安全影響的細節,請查看[Docker 進程表面攻擊細節](https://github.com/widuu/chinese_docker/blob/master/installation)
操作演示:
~~~
# Add the docker group if it doesn't already exist.
$ sudo groupadd docker
# Add the connected user "${USER}" to the docker group.
# Change the user name to match your preferred user.
# You may have to logout and log back in again for
# this to take effect.
$ sudo gpasswd -a ${USER} docker
# Restart the Docker daemon.
$ sudo service docker restart
##下一步
~~~
- 關于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服務