DevOps & Infrastructure

Beyond runc: New Container Runtimes Emerge

Everyone thought Docker's runc was the end-all, be-all. Turns out, the tech giants have been quietly building better isolation models for years. It's time we paid attention.

Diagram illustrating different container runtime isolation models

Key Takeaways

  • New container runtimes like Firecracker, gVisor, and Kata Containers offer superior isolation beyond the default runc.
  • These runtimes are being adopted by major cloud providers to enhance security and multi-tenancy for their services.
  • Developers must choose runtimes based on specific needs for isolation, latency, and compatibility, as performance trade-offs exist.
  • WASM represents a fundamentally different approach to secure code execution, not a direct replacement for Linux containers.

Everyone assumed that when you said ‘container runtime,’ you meant runc. It’s been the default, the quiet engine under the hood of Docker and Kubernetes for years. We’ve all been running our little Go web servers, our microservices, our CI jobs, blissfully unaware that for many cutting-edge workloads, runc is, frankly, starting to look a bit… quaint. The expectation was that the container ecosystem would simply iterate on this established model. This new wave of container runtimes? It blows that assumption out of the water.

Why the sudden departure from the familiar? Because the shiny, convenient isolation runc provides simply isn’t enough for some folks. AWS Lambda, the serverless darling? It’s not using a Docker container; it’s running your functions inside Firecracker microVMs. Fly.io’s fancy Machines? Another Firecracker fork. Google’s multi-tenant GKE nodes? They’re shielded by gVisor. And Cloudflare Workers? They’ve gone the WebAssembly (WASM) route entirely. These aren’t niche experiments; they’re the bedrock of massive, production-grade services. The reason? Their threat models, their latency demands, or frankly, both, screamed that the default was insufficient.

What’s the actual difference? The original article takes a humble 3MB Go HTTP server and throws it at five different runtimes: the familiar runc (with a distroless image, mind you), gVisor, Kata + QEMU, Kata + Firecracker, and WASM/WASI. The takeaway? What you see is what you get. The underlying OCI image remains identical across most. The real magic, or rather, the real trade-offs, lie in the cold start times and the memory footprint. We’re talking cold starts from a snappy 20ms with runc, all the way up to a leisurely 500ms for Kata/QEMU, with Firecracker landing somewhere in the middle at ~125ms. Steady-state request latency? Surprisingly similar. So, where’s the sting? Memory overhead and compatibility headaches, not a slow-down in throughput.

The Minimalist Baseline: Distroless runc

Let’s start with the familiar, but slightly stripped down. We’re talking about the default Docker runtime, runc, but paired with a distroless base image. No shell. No package manager. No apt, no curl. Just your Go binary and the bare minimum CA certificates. The resulting image? A featherweight 3MB. For context, an Alpine image clocks in around 18MB, and a full Ubuntu image? Forget about it, that’s 80MB. Distroless doesn’t change your isolation model – the container still shares the host kernel. What it does do is remove every single tool an attacker would use after a successful breach. You’re not preventing the exploit, but you’re making the post-exploit environment about as hospitable as a frozen tundra.

  • Use cases: Internal microservices within a trusted, single-tenant cluster. GitOps pipelines where you’re the sole gatekeeper of registry images. Simply replacing bloated Alpine images for the sheer size savings. It’s the security baseline every team should aim for before considering more complex runtime overhead.

gVisor: The User-Space Kernel

gVisor introduces a user-space Linux kernel, aptly named Sentry, written in Go. It lives alongside your container. Every single system call your application makes is intercepted by Sentry. The host kernel? It never sees a peep from your container. It’s a clever trick: docker run --rm --runtime=runsc -p 8080:8080 -e RUNTIME_NAME=gvisor micro-containers. That’s it. That’s the change. The Sentry meticulously re-implements the Linux ABI. Whether it’s intercepting via ptrace or the newer, significantly faster Systrap mode (which uses seccomp for interception), a kernel exploit within your container simply has nowhere to go to affect the host kernel. It’s a sandbox, not a fortress wall.

But let’s be clear: gVisor isn’t a VM. Your container still shares memory, CPU, and at certain layers, the host’s network stack. It’s a strong sandbox, yes, but not a hard boundary. Its threat model is explicitly syscall isolation. A container escape via a kernel CVE — think your dirty_pipe or a runc breakout — hits a dead end at the Sentry. The upside? Google’s GKE Sandbox is essentially gVisor, activated with a simple node pool annotation. And that Systrap mode? It’s now the default, finally eradicating the performance penalty that made early gVisor a tough sell. Plus, GPU support is production-ready for those hefty A100/H100 GPUs via vGPU passthrough – crucial if you’re sandboxing AI inference workloads.

  • Use cases: CI/CD runners are the undisputed champion here. Think self-hosted GitHub Actions, GitLab runners, or Buildkite agents executing arbitrary user pipelines. You don’t control the code; gVisor limits the blast radius. ML inference APIs that accept user-provided model weights or custom code (you can’t trust what’s in those pickles). SaaS platforms allowing user logic execution, like Zapier-style automations or Retool actions. Cloud IDE backends, offering Codespace-like environments where each user gets a container that feels like root, but isn’t.

Kata Containers: The VM Escape Hatch

Kata Containers takes a different tack: it spins up a lightweight QEMU MicroVM for each container. Your app lives inside a virtual machine, complete with its own kernel. From containerd’s perspective, it’s just another OCI runtime. But from your process’s viewpoint? It’s a dedicated Linux instance. The host sees a qemu-system-x86_64 process, and nothing inside can leak out. The container image is mounted via virtiofs, and the kernel boundary is, without question, real.

This is the only option that provides a true hardware-enforced boundary between container and host. gVisor is software isolation. Kata is a VM.

If your threat model absolutely necessitates that a kernel exploit inside the container cannot possibly affect the host, Kata is your answer. It’s the heavy-duty option for maximum isolation. However, this comes at a cost. The cold start times are noticeably longer, and the memory overhead is heftier because you’re running an entire VM. This is not for your ephemeral web server that needs to spin up and down in milliseconds. This is for when security trumps every other concern.

  • Use cases: Situations requiring the strongest possible isolation, such as running untrusted code in a multi-tenant environment where complete kernel separation is paramount. Think confidential computing scenarios or legacy applications that require a full OS environment for compatibility but need sandboxing. When you absolutely, positively need to ensure a container breakout cannot touch the host kernel, Kata is the solution.

Firecracker: The AWS-Born Lightweight VM

Developed by AWS, Firecracker is a lean virtual machine monitor designed specifically for running serverless workloads. It’s optimized for speed and security, booting extremely quickly and using minimal resources compared to traditional VMs. It’s what powers AWS Lambda and other AWS services. It offers a strong isolation boundary similar to Kata, but with a significantly reduced attack surface and faster boot times. It’s a middle ground between gVisor’s syscall interception and Kata’s full VM approach.

  • Use cases: Serverless platforms, multi-tenant container services, and any application where fast startup times and strong isolation are critical, but the overhead of a full VM is undesirable. It’s a sweet spot for many modern cloud-native applications.

WebAssembly (WASM): The Next Frontier?

WASM is a fundamentally different beast. It’s not about running Linux binaries in a sandboxed environment; it’s about compiling code to a bytecode that runs in a highly secure, sandboxed virtual machine. When you use WASM for containerization, you’re not just changing the runtime; you’re changing the compilation target. The isolation here is built into the WASM runtime itself, offering a potentially smaller attack surface and excellent performance for specific workloads. WASI (WebAssembly System Interface) provides a standardized way for WASM modules to interact with the underlying system.

  • Use cases: Edge computing, IoT devices, secure plugin architectures, and web applications requiring high performance and security. It’s a strong contender for running untrusted code in a highly controlled environment.

Who’s Actually Making Money Here?

Let’s cut through the jargon. Who benefits most from this migration away from runc? Cloud providers, primarily. AWS has Firecracker, Google has gVisor for GKE, and Cloudflare has WASM. They’re building services that rely on highly efficient, secure multi-tenancy. For them, the overhead of managing runc in a shared kernel environment is a security risk and a scalability bottleneck. By offering these more isolated runtimes, they can pack more tenants onto their hardware with greater confidence, driving more revenue. Developers building applications on these platforms benefit from the enhanced security and performance, but the primary financial incentive is with the infrastructure giants who are building the next generation of cloud services on these technologies. It’s a race to build more secure, scalable cloud platforms, and these runtimes are their weapons of choice.

Why Does This Matter for Developers?

For the average developer, the shift towards these alternative runtimes means a few things. Firstly, your application might need to be compiled differently (especially for WASM). Secondly, you need to understand the cold start implications. A 500ms cold start on Kata might be unacceptable for a latency-sensitive API. Conversely, a 20ms cold start with gVisor might be perfectly fine. You also need to consider the compatibility. Not all libraries and binaries will happily run in a distroless or gVisor environment without modification. The key is understanding your application’s needs – its security requirements, its latency sensitivity, and its resource constraints – and then choosing the runtime that best fits. The days of blindly accepting the default are over.

Is This the End of Docker?

Absolutely not. Docker, and the OCI standard it champions, is still the lingua franca for containerization. What’s happening is an evolution within the ecosystem. Docker can now orchestrate containers running under gVisor, Kata, or Firecracker. The docker run --runtime=... flag is precisely this flexibility in action. It means you can use the familiar Docker tooling while benefiting from the advanced isolation capabilities of these newer runtimes. It’s about choice and fitting the right tool to the job, not a wholesale replacement.


🧬 Related Insights

Frequently Asked Questions

What is the primary difference between runc, gVisor, and Kata Containers? Runc shares the host kernel with the container. gVisor provides syscall isolation by re-implementing a Linux kernel in userspace. Kata Containers provides VM-level isolation, running each container within its own lightweight virtual machine.

Will using gVisor or Kata Containers significantly impact my application’s performance? There’s typically some performance overhead compared to runc, particularly with cold starts. gVisor’s Systrap mode significantly reduces this overhead. Kata Containers, running a full VM, will generally have higher latency and memory usage than runc or gVisor for steady-state operations.

Is WASM a replacement for container runtimes like runc or Kata? WASM is a different execution environment altogether. It’s a bytecode format designed for sandboxed execution, often used for security-sensitive workloads. It’s not a direct replacement for Linux containers but offers an alternative for specific use cases requiring high security and portability.

Written by
Open Source Beat Editorial Team

Curated insights, explainers, and analysis from the editorial team.

Frequently asked questions

What is the primary difference between runc, gVisor, and Kata Containers?
Runc shares the host kernel with the container. gVisor provides syscall isolation by re-implementing a Linux kernel in userspace. Kata Containers provides VM-level isolation, running each container within its own lightweight virtual machine.
Will using gVisor or Kata Containers significantly impact my application's performance?
There's typically some performance overhead compared to runc, particularly with cold starts. gVisor's Systrap mode significantly reduces this overhead. Kata Containers, running a full VM, will generally have higher latency and memory usage than runc or gVisor for steady-state operations.
Is WASM a replacement for container runtimes like runc or Kata?
WASM is a different execution environment altogether. It's a bytecode format designed for sandboxed execution, often used for security-sensitive workloads. It's not a direct replacement for Linux containers but offers an alternative for specific use cases requiring high security and portability.

Worth sharing?

Get the best Open Source stories of the week in your inbox — no noise, no spam.

Originally reported by Dev.to

Stay in the loop

The week's most important stories from Open Source Beat, delivered once a week.