Basic Pattern
- Start from the OpenHands agent-server base image.
- Keep the normal OpenHands entrypoint intact: extend the image, do not replace it.
- Add your repo, docs, tools, and verification wrappers.
- Pre-run the expensive setup you do not want to repeat at task time.
- Push the image to a registry reachable from your OpenHands cluster.
Base Image
What is already inside the base image?
The full recipe - every preinstalled package, capability flag, and build stage - lives in
openhands-agent-server/openhands/agent_server/docker/Dockerfile
in the OpenHands/software-agent-sdk repository. Read it before duplicating
something that is already present.
Version Compatibility
Agent-server versions are largely forward and backward compatible: newer agent-servers work with older OpenHands releases and vice versa for the features they have in common. There is no strict version match at conversation start. The one exception is a per-feature minimum-version check. A handful of newer APIs (Hooks, MCP test, MCP OAuth, and any subsequent feature that ships with a declared floor) fail with anAGENT_SERVER_VERSION_TOO_OLD error, naming the
feature and its required version, if the sandbox’s agent-server predates that
feature. Building your image from too old a base image only affects those
specific features - everything else keeps working.
Each OpenHands Enterprise release still ships with a recommended default
tag. To find it, enable Use a Custom Sandbox Image in the Admin Console;
the Sandbox Image Tag field defaults to that recommended tag. See
ghcr.io/openhands/agent-server
for the full tag list.
Build and Push
--platform linux/amd64 because the Enterprise Replicated VM runs on x86-64.
For Helm installs, match the architecture of your sandbox nodes.
What to Bake In
Good candidates for prebaking:- Pinned repository checkouts
- Package manager caches and installed dependencies (
node_modules, Python virtualenvs, etc.) - Compiled or transpiled output
- Native system packages (
xvfb,libkrb5-dev,pkg-config, etc.) - Browser or Electron artifacts
- Stable helper scripts such as
prepare-*and*-verifywrappers
What to Keep Out
If the repository or dependencies change frequently, include aprepare-*
script in the image so the agent can refresh only the parts that need updating
without a full rebuild.
Complete Example
A realistic customization that bakes a pinned repository checkout, installs its dependencies, and ships aprepare-repo refresh script. The ENTRYPOINT
from the base image is inherited unchanged.
prepare-repo script (fetches and fast-forwards without
losing the prebaked dependency cache):
Private Registries
If your image lives in a private registry, provide pull credentials so the cluster can fetch it at pod start time. Replicated VM installs: set Registry Server, Registry Username, and Registry Password or Credentials in Config → Sandbox Configuration in the Admin Console and deploy. The installer renders an image pull secret that runtime pods automatically use. Helm installs: use node-level registry access where available. An EKS node role with ECR read access can pull a private ECR image without a pull secret. Otherwise, create a pull secret in the sandbox namespace and add its name to the runtime-apiRUNTIME_IMAGE_PULL_SECRETS environment variable
(comma-separated list of secret names). Verify that the custom warm pod
reaches Ready before selecting the image.
