debootstrap inside a docker container

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: Failure trying to run: chroot /var/chroot mount -t proc proc /proc

(in the log the problem turns out to be: mount: permission denied )

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?

Thanks a lot!


No, this is not currently possible.

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.


You could use the fakechroot variant of debootstrap, like this:

fakechroot fakeroot debootstrap --variant=fakechroot ...

Cheers!


Short answer, without privileged mode no there isn't a way.

Docker is targeted at micro-services and is not a drop in replacement for virtual machines. Having multiple installations in one container definitely not congruent with that. Why not use multiple docker containers instead?

链接地址: http://www.djcxy.com/p/82078.html

上一篇: CSS3动画滑动/隐藏导航以影响其他元素

下一篇: 码头集装箱内的debootstrap