Skip to content

Commit

Permalink
docs: improve custom sandbox guide with more configuration options (#…
Browse files Browse the repository at this point in the history
…5589)

Co-authored-by: openhands <[email protected]>
  • Loading branch information
neubig and openhands-agent authored Jan 17, 2025
1 parent a1a87af commit 62fbe4c
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions docs/modules/usage/how-to/custom-sandbox-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.

0 comments on commit 62fbe4c

Please sign in to comment.