在Docker容器内的debootstrap [英] debootstrap inside a docker container
问题描述
这是我的问题:我想在docker容器内部建立一个chroot环境。问题是debootstrap无法运行,因为它无法在chroot中挂载proc:
Here's my problem: I want to build a chroot environment inside a docker container. The problem is that debootstrap cannot run, because it cannot mount proc in the chroot:
W:尝试运行失败:chroot / var / chroot mount -t proc proc / proc
(在日志中,问题证明是: mount:permission denied
)
(in the log the problem turns out to be: mount: permission denied
)
如果我运行--privileged
容器,它(当然)工作...
我真的很希望在Dockerfile中引导chroot(更清洁)。有没有办法让它工作?
If I run --privileged
the container, it (of course) works...
I'd really really really like to debootstrap the chroot in the Dockerfile (much much cleaner). Is there a way I can get it to work?
非常感谢!
推荐答案
不,目前不可能。
问题#1916 (涉及在 docker build
期间运行特权操作)仍然是一个开放的问题。在添加命令行标志和 RUNP
命令的一点上进行了讨论,但都没有实现这些命令。
Issue #1916 (which concerns running privileged operations during docker build
) is still an open issue. There was discussion at one point of adding a command-line flag and RUNP
command but neither of these have been implemented.
这篇关于在Docker容器内的debootstrap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!