DockerIsol8 for local execution and RemoteIsol8 for connecting to a remote isol8 server. Both implement the Isol8Engine interface.
Installation
DockerIsol8
Executes code locally using Docker. This is the primary engine.Constructor Options
All options are optional with sensible defaults.Execution mode. Ephemeral uses the warm container pool. Persistent keeps a single container alive.
Container network mode.
Network filtering rules (only used when
network is "filtered").Docker memory limit string.
CPU cores (fractional).
Maximum number of processes.
Mount root filesystem as read-only.
Maximum output size in bytes before truncation.
Default execution timeout in milliseconds.
Size of the
/sandbox tmpfs mount.Size of the
/tmp tmpfs mount.Override Docker image. Ignores runtime adapter’s default image.
Secret environment variables. Values are injected into the container and automatically masked in output.
Keep the container running after execution completes instead of cleaning it up. Useful for debugging — inspect the container’s filesystem and state post-execution. This is different from
mode: "persistent", which keeps a container alive between runs for stateful sessions.Enable debug logging for internal engine operations. When
true, the engine prints detailed logs about container lifecycle, pool operations, and cleanup decisions with a [DEBUG] prefix. Does not affect the executed code’s output.RemoteIsol8
Connects to a remote isol8 server via HTTP.Container Cleanup
TheDockerIsol8 class provides a static utility method to remove all isol8 containers from your Docker environment. This is useful for maintenance, testing, and cleanup operations.
Cleanup Result
Thecleanup() method returns an object with:
Number of containers successfully removed.
Number of containers that failed to remove.
Array of error messages for failed removals (format:
"containerId: error message").Custom Docker Instance
You can pass a custom Docker instance to the cleanup method:Use Cases
Common scenarios for programmatic cleanup:The
cleanup() method only removes containers using isol8 images (isol8:* or isol8-custom:*). Your other Docker containers are never affected.Isol8Engine Interface
BothDockerIsol8 and RemoteIsol8 implement this interface: