Skip to main content
You declare the registries once at runtime level, and unqualified image names resolve against them in the order you list.

Prerequisites

  • A working BoxLite install (Python boxlite or Node @boxlite-ai/boxlite) and a machine with hardware virtualization — see Installation.
  • The target image registry is reachable from your machine; for a private registry, have credentials ready (username/password or bearer token).

How it works

When you create a box with a “non-fully-qualified” reference (such as image="alpine"), BoxLite must resolve it to a full reference (such as docker.io/library/alpine:latest).
  • With no registries configured, the default is docker.io (Docker Hub).
  • With image_registries configured, BoxLite tries each registry that has search=True in list order, and the first success wins; if all fail, it raises.
  • A fully-qualified reference (such as quay.io/prometheus/prometheus:v2.40.1) always skips the lookup list and pulls directly from that registry.
  • The SDK reads no local state: it does not automatically read any local config file. The registry list is supplied entirely by your code, so behavior is deterministic and does not depend on the host machine’s environment.

Quick Example

The simplest flow: have BoxLite check ghcr.io first, then fall back to docker.io, then create a box with alpine and run a command. You can copy and run it directly.

Private / authenticated registries

A private registry takes credentials via ImageRegistry’s username/password (Basic auth) or bearer_token (Bearer auth) fields. Username and password must be provided together; supplying only one raises.
For Bearer token auth, replace username/password with bearer_token:
Node puts auth in an auth sub-object, unlike Python’s flat fields.

Parameters and Returns

boxlite.Options (Python)

After construction, pass it to boxlite.Boxlite(options) to get a runtime handle (a synchronous context manager).

boxlite.ImageRegistry (Python)

Constructor signature: ImageRegistry(host, transport="https", skip_verify=False, search=False, username=None, password=None, bearer_token=None)

JsImageRegistry (Node)

Returns / behavior

Tip: box.exec(...) does not raise when a command exits with a non-zero code; it returns an ExecResult (Python fields exit_code/stdout/stderr; Node exitCode/stdout/stderr). Only image-level failures (pull/auth) raise.

Troubleshooting

transport is not a string literal

A common mistake is passing a boolean or an uppercase form. transport only accepts "https" or "http":
Fix: use the lowercase string transport="http" or transport="https" (defaults to https, can be omitted).

host was written as a URL

host must be host[:port]; it cannot have a protocol prefix or a path:
An empty host also raises: RuntimeError: image registry host is required.

Only a username was given (or only a password)

The two Basic auth fields must be paired:
Fix: provide both username and password; if using token auth, switch to bearer_token (Python) / auth.bearerToken (Node), and do not mix them.

A registry is configured but pulls still go to Docker Hub / the image is not found

The most common cause is not setting search=True. This field defaults to False, and a registry that is False does not participate in non-qualified-name lookup:
Also confirm you are not using a fully-qualified name — a fully-qualified name (with a host) bypasses the lookup list and pulls directly.

Self-signed / internal HTTPS certificate verification fails

An internal self-signed certificate causes TLS verification to fail. For a trusted internal registry you can set skip_verify=True (Python) / skipVerify: true (Node). This disables certificate and hostname verification, so only use it when you trust the network. For a plaintext HTTP registry, switch to transport="http" instead.

Image pull failure raises a standard exception, not BoxliteError

A missing command or an image pull failure raises a standard RuntimeError (Python) / bare Error (Node), not BoxliteError. See Error Handling.

Box fails to start: environment has no virtualization

BoxLite runs inside a microVM and needs hardware virtualization:
  • Linux: needs KVM (/dev/kvm accessible; on WSL2 the user must be in the kvm group).
  • macOS: via the built-in virtualization stack (Apple Hypervisor.framework), no /dev/kvm required.
  • Without virtualization, startup fails (the exception is catchable; the process does not crash).
This is unrelated to registry configuration — first confirm the base environment can start a box with image="alpine:latest" (default Docker Hub), then debug the registry configuration.
Related pages: Error Handling