- On-the-fly Installation: Install packages before each execution. Flexible but slower.
- Custom Images: Bake packages into the Docker image. Fast and reproducible.
Strategy 1: On-the-Fly Installation
Great for prototyping or when you need different packages for every run.- CLI
- Library
- API
Use
--install <package> (can be repeated).Runtime installs are written under
/sandbox (for example /sandbox/.local, /sandbox/.npm-global, /sandbox/.bun-global). This is intentional because /tmp is mounted noexec.Strategy 2: Custom Images (Recommended)
Bake your dependencies into a named custom Docker image. This eliminates installation time during execution.Creating Custom Images
Useisol8 build with an explicit --tag name:
my-python-ml) that extends the base isol8:python image. Metadata labels (org.isol8.runtime, org.isol8.dependencies) are embedded in the image for automatic discovery.
Using Custom Images
Once built, isol8 automatically discovers and uses matching custom images. When you pass--install flags, the engine queries local Docker images for one that already satisfies the requested runtime and dependencies — if found, it skips the install step entirely.
Listing Custom Images
See what custom images are available locally:org.isol8.runtime labels, their runtimes, and installed dependencies.
Config File (isol8.config.json)
Define prebuilt images in your config file to ensure they exist before the server starts or when running isol8 setup.
isol8 setup to build any missing images. The server (isol8 serve) also auto-builds these images on startup.
Image Architecture
Understanding how images are built helps optimize your setup.Base Images
isol8:python: Python 3.x + pipisol8:node: Node.js LTS + npmisol8:bun: Bun runtimeisol8:deno: Deno runtimeisol8:bash: Bash + apk
Custom Images
Custom images extend the base image. For example,my-python-ml is built like this:
Smart Discovery
When you request packages via--install or installPackages, the engine automatically:
- Searches local Docker images with
org.isol8.runtimeandorg.isol8.dependencieslabels - Prefers an exact match (same set of dependencies)
- Falls back to a superset match (image has all requested packages plus extras)
- If no match is found, uses the base runtime image and installs packages at runtime
--force on isol8 build to bypass caching and rebuild unconditionally.
FAQ
Should I use `--install` or custom images?
Should I use `--install` or custom images?
Use
--install for ad-hoc experimentation. Use custom images for repeatable production workloads and lower execution latency.Why do some native packages fail when installed in temp directories?
Why do some native packages fail when installed in temp directories?
Native modules often need executable mount points. isol8 installs runtime packages under
/sandbox because /tmp is mounted with noexec.How does the server handle prebuiltImages?
How does the server handle prebuiltImages?
On startup, the server iterates
config.prebuiltImages, checks if each image exists locally, and builds any missing ones before accepting connections. This ensures all declared environments are ready for execution.Troubleshooting quick checks
- Install step is too slow: pre-bake dependencies with
isol8 build --tag <name>or declare them inprebuiltImagesconfig. - Package import still fails after install: verify runtime/package pairing (for example Python package in Python runtime).
- Custom image not updating: rerun
isol8 build --tag <name> --force. - Disk usage growing from images: run
isol8 cleanup --imagesto remove isol8 images.
Reference
How to CLI
All
isol8 setup and isol8 build options and flags.Configuration
Full schema for
prebuiltImages in isol8.config.json.Execution guide
See install behavior in the full execution lifecycle.
Troubleshooting
Diagnose setup, install, and runtime issues.