You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/modules/usage/custom_sandbox_guide.md
+23-9Lines changed: 23 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,27 +1,38 @@
1
1
# 💿 How to Create a Custom Docker Sandbox
2
2
3
-
The default OpenDevin sandbox comes with a [minimal ubuntu configuration](https://github.com/OpenDevin/OpenDevin/blob/main/containers/sandbox/Dockerfile). Your use case may need additional software installed by default. This guide will teach you how to accomplish this by utilizing a custom docker image.
3
+
The default OpenDevin sandbox comes with a [minimal ubuntu configuration](https://github.com/OpenDevin/OpenDevin/blob/main/containers/sandbox/Dockerfile).
4
+
5
+
Your use case may need additional software installed by default.
6
+
7
+
There are two ways you can do so:
8
+
1. Use an existing image from docker hub. For instance, if you want to have `nodejs` installed, you can do so by using the `node:21` image.
9
+
2. Creating your own custom docker image.
10
+
11
+
If you want to take the first approach, you can skip the next section.
4
12
5
13
## Setup
6
14
7
15
Make sure you are able to run OpenDevin using the [Development.md](https://github.com/OpenDevin/OpenDevin/blob/main/Development.md) first.
8
16
9
17
## Create Your Docker Image
18
+
To create a custom docker image, it must be debian/ubuntu based.
10
19
11
-
Next you must create your custom docker image, which should be debian/ubuntu based. For example if we want want OpenDevin to have access to the "node" binary, we would use the following Dockerfile:
20
+
For example, if we want OpenDevin to have access to the "node" binary, we would use the following Dockerfile:
12
21
13
-
```bash
22
+
```dockerfile
14
23
# Start with latest ubuntu image
15
24
FROM ubuntu:latest
16
25
17
26
# Run needed updates
18
-
RUN apt-get update && apt-get install
27
+
RUN apt-get update && apt-get install -y
19
28
20
29
# Install node
21
30
RUN apt-get install -y nodejs
22
31
```
23
32
24
-
Next build your docker image with the name of your choice, for example "custom_image". To do this you can create a directory and put your file inside it with the name "Dockerfile", and inside the directory run the following command:
33
+
Next build your docker image with the name of your choice, for example "custom_image".
34
+
35
+
To do this you can create a directory and put your file inside it with the name "Dockerfile", and inside the directory run the following command:
25
36
26
37
```bash
27
38
docker build -t custom_image .
@@ -33,11 +44,11 @@ This will produce a new image called ```custom_image``` that will be available i
33
44
>
34
45
> Installing with apt-get above installs node for all users.
35
46
47
+
## Specify your sandbox image in config.toml file
36
48
37
-
## Specify your custom image in config.toml file
49
+
OpenDevin configuration occurs via the top-level `config.toml` file.
38
50
39
-
OpenDevin configuration occurs via the top level ```config.toml``` file.
40
-
Create a ```config.toml``` file in the OpenDevin directory and enter these contents:
51
+
Create a `config.toml` file in the OpenDevin directory and enter these contents:
41
52
42
53
```toml
43
54
[core]
@@ -46,7 +57,10 @@ persist_sandbox=false
46
57
run_as_devin=true
47
58
sandbox_container_image="custom_image"
48
59
```
49
-
> Ensure that sandbox_container_image is set to the name of your custom image from the previous step.
60
+
61
+
For sandbox_container_image, you can specify either:
62
+
1. The name of your custom image that you built in the previous step (e.g., "custom_image")
63
+
2. A pre-existing image from Docker Hub (e.g., "node:21" if you want a sandbox with Node.js pre-installed)
50
64
51
65
## Run
52
66
Run OpenDevin by running ```make run``` in the top level directory.
0 commit comments