Hides the rest of your computer
clone() drops the app inside private IDs and hostname views so it feels completely alone at PID 1.
A container isn't magic or a mini VM. It's an ordinary Linux app locked in a private room with a hard RAM cap, built from scratch in C++20.
First, Trishanku verifies Alpine 3.20 is unpacked on disk and opens a one-way walkie-talkie pipe. The new child process waits here until all fences are locked.
// Open a parent-to-child pause signal before starting
int sync_pipe[2];
pipe2(sync_pipe, O_CLOEXEC);
config.sync_pipe_read = sync_pipe[0];
// Confirm the unpacked Alpine folder is present
if (fs::exists(path / "etc" / "os-release", ec))
return fs::canonical(path, ec).string();Connects to your local C++ engine on port 8080 when running, or lets you test every container lock right in the browser.
clone() drops the app inside private IDs and hostname views so it feels completely alone at PID 1.
pivot_root(2) swaps the `/` folder pointer to an 8 MB Alpine folder and detaches your host drive.
Writing memory.max and swap=0 forces Linux to kill any process the instant it crosses its RAM budget.
A lightweight TypeScript server launches the compiled binary and pushes every terminal line over WebSockets.
The simple idea
A container is not a mini VM — it is one ordinary app wearing Linux blinders for privacy and strict fences for memory.
Plain-English answers to the four trickiest kernel bugs hit while building Trishanku.
chroot only changes folder names — a clever program can keep an old folder handle open and escape. pivot_root switches the real drive mount and unmounts your host disk completely.
Without a pause signal, the new child might race ahead and allocate memory before the parent finishes writing its cgroup caps. Waiting for 1 byte guarantees limits lock first.
When physical RAM runs out, Linux quietly moves extra pages onto your SSD instead of stopping the app. Setting swap to zero triggers a clean OOM exit 137 right at the limit.
Arch Linux keeps tools in /usr/bin, while Alpine BusyBox links sit inside /bin. Resetting PATH prevents bare commands like ls or uname from failing with exit 127.