【问题标题】:Docker build Gentoo operation not permitted不允许 Docker 构建 Gentoo 操作
【发布时间】:2018-09-09 09:52:24
【问题描述】:

我有一个 docker-compose 和这个容器来构建 Gentoo

default:
    build: docker/gentoo
    hostname: default.jpo.net

我在多阶段构建中设置 Gentoo 的 Dockerfile 是

FROM gentoo/portage as portage

FROM gentoo/stage3-amd64

COPY --from=portage /usr/portage /usr/portage

RUN emerge --jobs $(nproc) -qv www-servers/apache net-misc/curl net-misc/openssh

RUN /usr/bin/ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N ''
RUN /usr/bin/ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N ''
RUN sed -i 's/#PubkeyAuthentication/PubkeyAuthentication/' /etc/ssh/sshd_config
RUN mkdir -p /root/.ssh && chmod 700 /root/.ssh && touch /root/.ssh/authorized_keys

RUN wget -O telegraf.tar.gz http://get.influxdb.org/telegraf/telegraf-0.11.1-1_linux_amd64.tar.gz \
    && tar xvfz telegraf.tar.gz \
    && rm telegraf.tar.gz \
    && mv /usr/lib/telegraf /usr/lib64/telegraf \
    && rm -rf /usr/lib && ln -s /usr/lib64 /usr/lib

ADD telegraf.conf /etc/telegraf/telegraf.conf

COPY entrypoint.sh /
COPY infinite_curl.sh /
RUN chmod u+x /entrypoint.sh /infinite_curl.sh
ENTRYPOINT ["/entrypoint.sh"]

CMD ["telegraf", "-config", "/etc/telegraf/telegraf.conf"]

问题是在emerge 命令安装包时构建失败。

然后我得到这个错误

PermissionError: [Errno 1] Operation not permitted
 * ERROR: dev-libs/apr-1.5.2::gentoo failed (install phase):
 *   dodoc failed

我尝试在我的 docker-compose 文件中添加 privileged=true 并在我的 Dockerfile 中添加 USER root 但没有成功。

我也尝试使用openssh 的最新版本也没有成功。 我搜索了互联网,但我没有找到任何成功的东西。

Docker 版本

Docker version 17.12.0-ce, build c97c6d6

Docker-compose 版本

docker-compose version 1.18.0, build 8dd22a9

我在 Ubuntu 16.04 上,这个构建在具有相同 docker/docker-compose 版本的 Ubuntu 17.10 上运行良好

你有什么线索吗?

【问题讨论】:

  • 如果你以 root 身份运行 docker-compose?
  • @ConstantinGalbenu 同样的错误

标签: docker permissions docker-compose gentoo


【解决方案1】:

查看src-install() 中的ebuild,这似乎是上游的错误。

# 自 4 月 1.5.1 起 Pralel 安装中断

#make -j1 DESTDIR="${D}" 安装 ||死去

有几个two bugs与并行构建apr相关。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-09-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-03
    • 2015-02-18
    • 1970-01-01
    相关资源
    最近更新 更多