diaporos and Docker · all pages

Start

Guides

Reference

Project

  1. Docs
  2. Guides
  3. diaporos and Docker

diaporos and Docker

How each app gets its own runtime and dependencies without images, and what that changes.

  • 3 min read
  • 5 sections

The question this answers: a core reason for Docker is that every app gets its own runtime, package versions and dependencies. How does diaporos do that, and what is the benefit?

Short answer

diaporos keeps that promise and changes how the bundle is packaged, shipped and isolated.

How an app gets its own runtime

A diaporos release is a tree: a directory with a diaporos.contract at its root that contains everything the app needs: its interpreter (e.g. its own node binary), its packages (node_modules, a Python venv, JARs) and the shared libraries (.so) they load. App A can run Node 18 and app B Node 22 on the same host with no shared versions, the same as two Docker images, without the image format.

Where diaporos differs

Docker diaporos
Unit of reuse Layers: change one file and the whole layer ships again Individual files, addressed by content hash; only changed files ship, as patches where possible
Dependency bump (NestJS API) 1.01 GB layer, 245 s 85 KiB, 26 s
One-line change (NestJS API) 90 s 3.7 KiB, 19 s
Shared files across apps and versions Only if layers happen to match Stored once per node
Isolation Namespaces, cgroups, seccomp Landlock (files), cgroups (cpu/memory/pids), an unprivileged uid, and a port allowlist from the contract (--runner sandbox, Linux)
Permissions declared up front No Yes: the contract lists the ports, environment variables and files the app may use
Moving parts Docker daemon, registry, and Kubernetes for a fleet One binary per node, plus a store

The NestJS API numbers are from one node on a local network, with a Dockerfile that copies node_modules from the build context (see Results), so they favour diaporos. Say that when quoting them.

What diaporos doesn’t cover yet

  • The host’s C library (glibc). A tree built with diaporos bundle ships every library except the C library, so it still needs the host’s glibc (or musl) at least as new as the build’s. A Docker image brings its whole userland. diaporos import closes most of this: an imported image runs through its own loader and libc, so an Alpine image runs on a glibc host. The rest (the image’s /etc, programs it starts by absolute path) needs mount namespaces.
  • Isolation is lighter than a container’s. No namespaces or seccomp yet; net.connect is enforced by port, not host; TCP rules need kernel 6.7+. The default process runner only scrubs the environment.
  • Migration is one command, with caveats. diaporos import <image> turns an image into a tree and a contract, but the service runs as a process: the image’s User, Volumes and Healthcheck don’t carry over, and commands that need a shell must be replaced with --exec. The import prints a note for each. A Node.js repo can skip the image: diaporos init <checkout> reads the start command, port, health path, memory limit and variable names from its Dockerfile, .env and Helm chart, and comments each contract line with where it came from.

One line

“diaporos gives every app its own runtime and dependencies like Docker does. Instead of layered images, a release is a content-addressed file tree, so a dependency bump ships kilobytes instead of a gigabyte. Each app also declares up front what it’s allowed to touch, and the Linux sandbox enforces most of it. The trade-off today is that it still uses the host’s glibc and its isolation is lighter than a container’s.”

↑↓ to move ↵ to open