My goal is to standup a chroot with the basic Unix tool-set (bash
, cp
, touch
, cat
, etc) and any necessary dependencies need to run apt get
inside a codespace. Using debootstrap gets me close. The basic tools are installed and I can run apt get
. The problem is subprocess do not work. I expect the last line to print "test" but actually I get an error saying that the subprocess' file handle is no good. I would have thought the vanilla debootstrap environment would be sufficiently cooked so that subprocess work, but that does not seem to be the case. Is there a switch I can pass?
$ sudo apt-get install -y binutils debootstrap
$ cd /home/codespace
$ CHROOT=/home/codespace/chroot
$ mkdir -p "${CHROOT}"
$ sudo debootstrap stable "${CHROOT}" http://deb.debian.org/debian/
$ sudo chroot "${CHROOT}"
$ cat < <(echo test)
bash: /dev/fd/63: No such file or directory
To reproduce,
- sign up for codespaces beta here.
- fire up a codespace for this project, open a bash shell (ctrl+`).
- run the above.
This also reproduces outside of codespace so any Ubuntu environment will probably yield similar results.
/proc/$$
is not resolving. This SO post answer discusses what/proc/self
is and is not. Whatever it is, it isn't work in my chroot! – Christopher King Jul 01 '22 at 23:13