docker.md 1.1 KB

Build your own agent Docker image

This section is about modifying the Docker image in which we run the commands suggested by the agent.

There are two reasons to build your own Docker image

  1. You need a very specific environment to install your package (anything that you cannot simply install inside of a conda environment)
  2. You want to pre-install your package for speedup.

There are three steps involved:

  1. Modify the swe.Dockerfile Dockerfile (also shown below). We provide some extended explanation of the Dockerfile here.
  2. Build the image. One way is to simply run ./setup.sh. Alternatively, especially if you want to change the default tag (sweagent/swe-agent:latest), run

    docker build -t "YOUR TAG HERE" -f docker/swe.Dockerfile \
     --build-arg TARGETARCH=$(uname -m) .
    
    1. Make sure you use the new image by passing the --image_name flag to run.py.

    Default Dockerfile:

    --8<-- "docker/swe.Dockerfile"