在 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 頻道來提問。
如果你正在尋找一個 -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。
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 tree 和 docker-overlay 的最新版本還是有差距的,請耐心等待,最新版本會很快更新。
請確保您運行的內(nèi)核包含了所有必要的模塊和配置(可選的 device-mapper 和 AUFS 或 Btrfs ,這主要取決于你要使用的存儲驅(qū)動程序)。
使用 Docker,docker 進程必須以 root 用戶運行。
用 非root 用戶使用 Docker,可以使用下邊的命令,將你自己的用戶添加到 docker 用戶組 。
$ sudo usermod -a -G docker user
啟動 docker
進程:
$ sudo /etc/init.d/docker start
開機啟動:
$ sudo rc-update add docker default
啟動 docker
進程:
$ sudo systemctl start docker.service
開機啟動:
$ sudo systemctl enable docker.service