鍍金池/ 教程/ Linux/ Gentoo
docker用戶指南
鏡像
在Docker中運行SSH進程服務(wù)
Docker Hub
CentOS
Rackspace Cloud
Red Hat Enterprise Linux
在Docker中運行Reids服務(wù)
FrugalWare
管理容器數(shù)據(jù)
Debian
Docker中運行MongoDB
Gentoo
在Docker中使用Riak服務(wù)
IBM SoftLayer
在Docker中運行Apt-Cacher-ng服務(wù)
開始使用Docker Hub
Amazon EC2
在Docker中運行"hello Word"應(yīng)用
Docker Hub上的倉庫和鏡像
Ubuntu
Docker Hub賬戶
Docker中運行Node.js web應(yīng)用
Docker中運行CouchDB服務(wù)
Fedora
Binaries
CRUX Linux
使用Docker Hub
Mac OS X 安裝 Docker
在Docker中運行PostgreSQL
創(chuàng)建一個基本鏡像
Docker Hub上的自動化構(gòu)建
連接容器
Google Cloud Platform
使用docker第一步
使用docker鏡像
Arch Linux
openSUSE
使用容器
Microsoft Windows 安裝docker

Gentoo

在 Gentoo Linux 上安裝 Docker 可以通過以下兩種方式的任一種實現(xiàn):官方安裝方法和 docker-overlay 方法。

官方 Gentoo Docker 團隊頁面。

官方方式

如果你正在尋找一種穩(wěn)定的方案,最好的辦法就是直接在 portage tree 上安裝官方的 app-emulation/docker 包。

如果 ebuild 時出現(xiàn)任何問題,包括缺少內(nèi)核配置標識或依賴,請到 Gentoo 的 Bugzilla 網(wǎng)站上指定的 docker AT gentoo DOT org 提交問題,或者加入 Freenode 的 Gentoo 官方 IRC 頻道來提問。

docker-overlay 方法

如果你正在尋找一個 -bin ebuild, live ebuild, 或者 bleeding edge ebuild,可以使用 overlay 提供的docker-overlay。使用 app-portage/layman 來添加第三方的 portage。查看最新的安裝和使用 overlay 的文檔請,請點擊 the overlay README。

如果 ebuild 或者生成的二進制文件時出現(xiàn)任何問題,包括特別是缺少內(nèi)核配置標識或依賴關(guān)系,請 在 docker-overlay 倉庫提交一個 issue 或者直接在 freenode 網(wǎng)絡(luò)的 #docker IRC 頻道上聯(lián)系 tianon。

安裝

Available USE flags

USE Flag Default Description
aufs Enables dependencies for the "aufs" graph driver, including necessary kernel flags.
btrfs Enables dependencies for the "btrfs" graph driver, including necessary kernel flags.
contrib Yes Install additional contributed scripts and components.
device-mapper Yes Enables dependencies for the "devicemapper" graph driver, including necessary kernel flags.
doc Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally.
lxc Enables dependencies for the "lxc" execution driver.
vim-syntax Pulls in related vim syntax scripts.
zsh-completion Enable zsh completion support.

這個包會適當?shù)墨@取必要的依賴和提示的內(nèi)核選項。

tianon's 的博客中有詳細的使用標識的介紹。

$ sudo emerge -av app-emulation/docker

注:有時候官方的 Gentoo treedocker-overlay 的最新版本還是有差距的,請耐心等待,最新版本會很快更新。

啟動 Docker

請確保您運行的內(nèi)核包含了所有必要的模塊和配置(可選的 device-mapper 和 AUFS 或 Btrfs ,這主要取決于你要使用的存儲驅(qū)動程序)。

使用 Docker,docker 進程必須以 root 用戶運行。

非root 用戶使用 Docker,可以使用下邊的命令,將你自己的用戶添加到 docker 用戶組 。

    $ sudo usermod -a -G docker user

OpenRC

啟動 docker 進程:

    $ sudo /etc/init.d/docker start

開機啟動:

    $ sudo rc-update add docker default

systemd

啟動 docker 進程:

    $ sudo systemctl start docker.service

開機啟動:

    $ sudo systemctl enable docker.service
上一篇:Arch Linux下一篇:docker用戶指南