Choosing a Runtime Base on Zerops
The OS is part of the base identifier, never a separate field: alpine/<tech>@<ver> or ubuntu/<tech>@<ver> — the same value in the import type and in both build.base and run.base of zerops.yaml. Always write the prefix: a bare <tech>@<ver> is legacy and resolves differently per file (import → Ubuntu, zerops.yaml → Alpine), and run.base rewrites the service OS on every deploy.
Prefer Alpine for standard apps. Switch to Ubuntu only for glibc needs (musl incompatibility): CGO-enabled Go, glibc-built Python/C-extension wheels, or the Deno runtime (Ubuntu image only). Needing a package is NOT itself a reason — both bases install packages (sudo apk add / sudo apt-get install). Use Docker only for pre-built images.
Decision Matrix
| Need | Choice | Why |
|---|---|---|
| Any standard app | Alpine (default) | ~5MB, fast, secure, sufficient for 95% of apps |
| glibc / CGO / C-extensions / Deno | Ubuntu | musl-incompatible binaries; Deno has no Alpine build (~100MB) |
| Pre-built Docker images | Docker | VM-based, bring your own image |
Ubuntu
- Size: ~100MB base
- Package manager:
sudo apt-get update && sudo apt-get install -y <pkg>(sudo required) - Version: 26.04 LTS (24.04 and 22.04 also available)
- Use when: you need glibc (musl incompatibility) — CGO-linked Go, glibc-built C-extensions, or the Deno runtime (no Alpine build). Needing a package is NOT a reason — both bases install packages
- Example: Go apps with CGO, Python packages with C extensions that don't compile on musl
Docker
- Runs in a VM (not a container) — slower boot, higher overhead
- Network: Must use
--network=hostornetwork_mode: hostin compose - Scaling: Fixed resources only (no min-max auto-scaling), VM restarts on resource change
- Disk: Can only increase, never decrease without recreation
- Build phase runs in containers (not VMs)
- Always use specific version tags —
:latestis cached and won't re-pull