Skip to content

Docker

Build the sandbox image and add the sandbox block to your faraday.yaml:

Terminal window
docker build -f Dockerfile.sandbox -t faraday-code-sandbox .
sandbox:
backend: docker
workspace:
container_path: /workspace

That’s it — Faraday runs on the host, code executes in a faraday-code-sandbox container.

Use your own Dockerfile to control what’s installed in the sandbox:

sandbox:
backend: docker
dockerfile: ./Dockerfile.my-sandbox
docker_image: my-custom-sandbox

Faraday auto-builds the image when it isn’t found locally. If you omit docker_image, it tags the build as faraday-code-sandbox.

To use a pre-built image instead:

sandbox:
docker_image: my-org/science-sandbox:latest

Use --use-docker to run Faraday itself inside a container:

Terminal window
faraday --use-docker "Your query here"

This builds faraday-oss if needed, bind-mounts your cwd at /workspace, and mounts the Docker socket for sandbox sidecars. See examples/configs/docker.yaml for a full app-in-Docker config.

Terminal window
docker build -f Dockerfile.main -t faraday-oss .
docker build -f Dockerfile.sandbox -t faraday-code-sandbox .