Run a Glibc-incompatible Binary Using chroot
You are provided with a binary located at /home/laborant/app/processor.
Try executing it directly on this Ubuntu machine:
/home/laborant/app/processor
You will notice that execution fails immediately with cannot execute: required file not found. This happens because the binary was dynamically compiled against musl libc and expects the dynamic linker /lib/ld-musl-x86_64.so.1, which is not present in Ubuntu's standard glibc root filesystem.
To solve this dependency issue without altering the host OS, you will isolate and run the application inside an Alpine Linux root filesystem at /tmp/newroot using chroot.

Objectives
- Export Alpine Rootfs:
Use the pre-installed
cranetool to export the filesystem ofalpine:latestand extract it into/tmp/newroot. - Place Binary Inside Rootfs:
Copy the application directory
/home/laborant/appinto/tmp/newroot/appso it is accessible within the new root directory. - Execute in chroot:
Run
/app/processorinside the chroot jail usingsudo chroot.
Hint 1: Exporting an image rootfs with crane
crane export <image> - streams the container filesystem tarball to standard output. You can pipe it directly to tar:
mkdir -p /tmp/newroot
crane export alpine:latest - | tar -xf - -C /tmp/newroot
Hint 2: Running a command in chroot
Once the rootfs is extracted and the app is placed inside /tmp/newroot/app/, execute:
sudo chroot /tmp/newroot /app/processor
Hint 3: Need a Refresher on chroot Basics?
Check out the tutorial Change Your Root: Chroot Basics to learn how the chroot system call manages process root pointers, shared library resolution, and root filesystem isolation.