Menu

1 / 22

A code execution sandbox in Go without Docker, just plain linux tooling : r/golang

#golang#redditgolang#go#reddit#photo
Reading 0:00
15s threshold

r/golang

3d ago

u/Anga205

A code execution sandbox in Go without Docker, just plain linux tooling

I built a Containerization API that executes untrusted code and returns output plus memory and CPU metrics. Instead of running a container per submission, it creates the boundary directly with Linux primitives: PID, mount, network, and user namespaces, a chroot into a minimal per-language rootfs, cgroups v2 for memory and CPU limits, and a seccomp-BPF denylist. The sandbox root maps to host UID 65534, so root inside is never root outside.

It supports Python, C++17, C11, and Java, capped at 60s and 128MB, with a global admission controller that rejects work before a sandbox is created.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.