【发布时间】:2015-08-20 11:16:32
【问题描述】:
我在 Docker-Container 中使用 Docker 和 Arch Linux。 介绍 makepkg-4.2.0 我的 yaourt 安装命令被破坏,如下所述:https://github.com/archlinuxfr/yaourt/issues/67
问题是,yaourt 应该以非 root 用户身份运行。但是由于 yaourt 还希望在每个案例中都安装包,所以在构建它之后,需要 root 用户或具有安装包权限的用户。
所以我的问题是如何解决这个问题?我想在 Docker 中从 AUR 安装一个包,因为还没有官方包。
直到现在我还在使用 Arch Linux、pacman 和 yaourt。
所以命令,
RUN yaourt -S --noconfirm aur/taskd
安装taskd,在makepkg-4.2.0之前工作:
使用新的 makepkg 版本构建 Docker 失败,并出现以下来自 yaourt 的错误:
makepkg: invalid option '--asroot'
如果我将用户更改为非 root 用户并尝试安装包,我会在自动构建中收到命令提示符,要求输入 Root 密码以实际安装包。
Password: su: Authentication information cannot be recovered
Password: su: Authentication information cannot be recovered
Password: su: Authentication information cannot be recovered
The command [/bin/sh -c yaourt -S --noconfirm aur/taskd] returned a non-zero code: 1
在不污染分布在两个 Dockerfile 上的许多离题行的情况下,Dockerfile 的有趣部分如下所示:
FROM kaot/arch_linux_base:latest
MAINTAINER Kaot
RUN useradd --no-create-home --shell=/bin/false yaourt && usermod -L yaourt
RUN yaourt -S --noconfirm aur/taskd
ENTRYPOINT ["/controlcenter/controlcenter.sh"]
CMD ["cc:start"]
【问题讨论】:
-
你能展示你的 Dockerfile 或复制器吗?
-
@user2915097:我添加了一个最小的 Dockerfile,它应该包含重要的行,而忽略了离题的行。