#921815 debootstrap umount "host" /proc when running in a Docker container

#921815#5
Date:
2019-02-09 04:01:32 UTC
From:
To:
Hi

When running debootstrap inside a Docker container, debootstrap umount both /proc and $TARGET/proc.
This is due to a missing check at:
https://salsa.debian.org/installer-team/debootstrap/blob/67a3c1c5f7ef44a6596f75b787289b3392c50759/scripts/debian-common#L104
Due to the missing check debootstrap umount "$TARGET/proc", which is a symlink to /proc [1].

I will open a MR shortly.

[1] https://salsa.debian.org/installer-team/debootstrap/blob/67a3c1c5f7ef44a6596f75b787289b3392c50759/scripts/debian-common#L68

- Kristian Klausen

#921815#10
Date:
2019-02-09 17:54:28 UTC
From:
To:
I have opened a MR: https://salsa.debian.org/installer-team/debootstrap/merge_requests/26
#921815#15
Date:
2020-02-23 13:01:37 UTC
From:
To:
control: tags -1 +moreinfo

Hi,

 How do I check it?

 - run docker
 - get debootstrap 1.0.110 and install it
 - debootstrap sid sid
 - /proc is there inside docker as below

#921815#22
Date:
2020-06-06 19:20:04 UTC
From:
To:
control: tags -1 -moreinfo

Hi
Sorry for the late response. I wasn't subscribed to the bug (I assume?).
regular non-privileged container.

I just tried and "/proc" is unmounted:
$ docker run --privileged --rm -t -i debian:stretch-backports bash
$ apt-get update && apt-get install -y -t stretch-backports debootstrap
$ debootstrap stretch chroot
$ ls /proc # it is empty

I also tried the debootstrap version in sid:
$ docker run --privileged --rm -t -i debian:sid bash
$ apt-get update && apt-get install -y debootstrap
$ debootstrap sid chroot
$ ls /proc # it is empty

Also please see the MRs:
https://salsa.debian.org/installer-team/debootstrap/-/merge_requests/26
https://salsa.debian.org/installer-team/debootstrap/-/merge_requests/27
https://salsa.debian.org/installer-team/debootstrap/-/merge_requests/30

I'm not sure which approach is the best, but Eicke did a short analysis:
https://salsa.debian.org/installer-team/debootstrap/-/merge_requests/26#note_171042
--- - Kristian Klausen
#921815#29
Date:
2022-01-05 09:57:00 UTC
From:
To:
Dear Maintainer,

Reproducable:
$ docker run --rm -it --privileged debian:bullseye bash
$ apt update && apt install debootstrap
$ apt policy debootstrap # shows version 1.0.123 is installed
$ debootstrap bullseye chroot

Output:
I: Target architecture can be executed
I: Retrieving InRelease
...
I: Extracting zlib1g...
W: Failure trying to run: chroot "//chroot" mount -t proc proc /proc
W: See //chroot/debootstrap/debootstrap.log for details
I: Installing core packages...
...
I: Base system installed successfully.

Checking output:
$ echo $? # return 0
$ ls /proc # its empty!

I have noticed when you use a debian stretch container, everything is ok.
This means the issue was not there in debootstrap 1.0.89

#921815#34
Date:
2023-11-08 20:49:51 UTC
From:
To:
While triaging #919659, I found this bug report.

I've tried with buster (oldstable):

docker run --rm -it --privileged debian:buster bash
apt-get update
apt-get install debootstrap
debootstrap --version
-> debootstrap 1.0.114+deb10u1
debootstrap buster chroot

It works, debootstrap reports:
I: Base system installed successfully.

With kind regards,
Roland Clobus

#921815#39
Date:
2023-11-27 04:58:16 UTC
From:
To:
reopen 921815
thanks
[…]

But did you also test whether /proc was not umounted?

bye,
//mirabilos

#921815#48
Date:
2023-11-27 07:14:46 UTC
From:
To:
Hello Thorsten,

Before and after the debootstrap command, the output of mount inside the
docker container is identical.

Then I exit the docker container, and in the host (running sid) /proc is
still mounted. So all is as expected.

What did you see when you tested while reopening this bug report?

With kind regards,
Roland Clobus

#921815#53
Date:
2023-11-27 16:17:39 UTC
From:
To:
Do you want to have a more exact version? Which I closed this issue, I
used the version that is present in Buster. (Version: 1.0.114+deb10u1)
Going deeper into older versions didn't seen necessary to me.

With kind regards
Roland Clobus

#921815#58
Date:
2023-11-28 00:04:04 UTC
From:
To:
close 921815 1.0.114+deb10u1
thanks

Yeah, that’s probably fine, thanks.