Gentoo Linux 安装 Docker教程:官方和 docker-overlay 方法

2023-07-0910:01:12服务器及运维Comments1,060 views字数 1682阅读模式

Gentoo Linux 上安装 Docker 可以通过以下两种方式的任一种实现:官方安装方法和 docker-overlay 方法。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50698.html

官方 Gentoo Docker 团队页面。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50698.html

官方方式

如果你正在寻找一种稳定的方案,最好的办法就是直接在 portage tree 上安装官方的 app-emulation/docker 包。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50698.html

如果 ebuild 时出现任何问题,包括缺少内核配置标识或依赖,请到 Gentoo 的 Bugzilla 网站上指定的 docker AT gentoo DOT org 提交问题,或者加入 Freenode 的 Gentoo 官方 IRC 频道来提问。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50698.html

docker-overlay 方法

如果你正在寻找一个 -bin ebuild, live ebuild, 或者 bleeding edge ebuild,可以使用 overlay 提供的docker-overlay。使用 app-portage/layman 来添加第三方的 portage。查看最新的安装和使用 overlay 的文档请,请点击 the overlay README。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50698.html

如果 ebuild 或者生成的二进制文件时出现任何问题,包括特别是缺少内核配置标识或依赖关系,请 在 docker-overlay 仓库提交一个 issue 或者直接在 freenode 网络的 #docker IRC 频道上联系 tianon。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50698.html

安装

Available USE flags

USE FlagDefaultDescription
aufsEnables dependencies for the “aufs” graph driver, including necessary kernel flags.
btrfsEnables dependencies for the “btrfs” graph driver, including necessary kernel flags.
contribYesInstall additional contributed scripts and components.
device-mapperYesEnables dependencies for the “devicemapper” graph driver, including necessary kernel flags.
docAdd extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally.
lxcEnables dependencies for the “lxc” execution driver.
vim-syntaxPulls in related vim syntax scripts.
zsh-completionEnable zsh completion support.

这个包会适当的获取必要的依赖和提示的内核选项。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50698.html

tianon’s 的博客中有详细的使用标识的介绍。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50698.html

$ sudo emerge -av app-emulation/docker

注:有时候官方的 Gentoo tree 和 docker-overlay 的最新版本还是有差距的,请耐心等待,最新版本会很快更新。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50698.html

启动 Docker

请确保您运行的内核包含了所有必要的模块和配置(可选的 device-mapper 和 AUFS 或 Btrfs ,这主要取决于你要使用的存储驱动程序)。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50698.html

使用 Docker,docker 进程必须以 root 用户运行。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50698.html

用 非root 用户使用 Docker,可以使用下边的命令,将你自己的用户添加到 docker 用户组 。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50698.html

$ sudo usermod -a -G docker user

OpenRC

启动 docker 进程:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50698.html

$ sudo /etc/init.d/docker start

开机启动:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50698.html

$ sudo rc-update add docker default

systemd

启动 docker 进程:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50698.html

$ sudo systemctl start docker.service

开机启动:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50698.html

$ sudo systemctl enable docker.service

如果你想要添加一个 HTTP 代理,为 Docker 运行文件设置不同的目录或分区,又或者定制一些其它的功能文章源自菜鸟学院-https://www.cainiaoxueyuan.com/yunwei/50698.html

  • 本站内容整理自互联网,仅提供信息存储空间服务,以方便学习之用。如对文章、图片、字体等版权有疑问,请在下方留言,管理员看到后,将第一时间进行处理。
  • 转载请务必保留本文链接:https://www.cainiaoxueyuan.com/yunwei/50698.html

Comment

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定