Skip to content

🙌 OpenHands: AI-Driven Development

docs: improve custom sandbox guide with more configuration options (#5589)

Graham Neubig62fbe4c6223f
diff --git a/docs/modules/usage/how-to/custom-sandbox-guide.md b/docs/modules/usage/how-to/custom-sandbox-guide.md
index 154e1117ae..a01d7c401b 100644
--- a/docs/modules/usage/how-to/custom-sandbox-guide.md
+++ b/docs/modules/usage/how-to/custom-sandbox-guide.md
@@ -18,15 +18,21 @@ If you choose the first option, you can skip the `Create Your Docker Image` sect
To create a custom Docker image, it must be Debian based.
-For example, if you want OpenHands to have `ruby` installed, create a `Dockerfile` with the following content:
+For example, if you want OpenHands to have `ruby` installed, you could create a `Dockerfile` with the following content:
```dockerfile
-FROM debian:latest
+FROM nikolaik/python-nodejs:python3.12-nodejs22
# Install required packages
RUN apt-get update && apt-get install -y ruby
```
+Or you could use a Ruby-specific base image:
+
+```dockerfile
+FROM ruby:latest
+```
+
Save this file in a folder. Then, build your Docker image (e.g., named custom-image) by navigating to the folder in
the terminal and running::
```bash
@@ -55,6 +61,28 @@ This can be an image you’ve already pulled or one you’ve built:
sandbox_base_container_image="custom-image"
```
+### Additional Configuration Options
+
+The `config.toml` file supports several other options for customizing your sandbox:
+
+```toml
+[core]
+# Install additional dependencies when the runtime is built
+# Can contain any valid shell commands
+# If you need the path to the Python interpreter in any of these commands, you can use the $OH_INTERPRETER_PATH variable
+runtime_extra_deps = """
+pip install numpy pandas
+apt-get update && apt-get install -y ffmpeg
+"""
+
+# Set environment variables for the runtime
+# Useful for configuration that needs to be available at runtime
+runtime_startup_env_vars = { DATABASE_URL = "postgresql://user:pass@localhost/db" }
+
+# Specify platform for multi-architecture builds (e.g., "linux/amd64" or "linux/arm64")
+platform = "linux/amd64"
+```
+
### Run
Run OpenHands by running ```make run``` in the top level directory.