main. Other containers provide the services it needs. All belong to one trial.
Add a small HTTP service
This environment gives the agent a JSON file through an HTTP service. Add it to a task with an instruction and verifier.my-task
instruction.md
task.toml
environment
Dockerfile
docker-compose.yaml
api
Dockerfile
status.json
tests
test.sh
environment/docker-compose.yaml:
environment/docker-compose.yaml
main from environment/Dockerfile and api from its own Dockerfile. depends_on waits for the API healthcheck. From main, the agent can read http://api:8000/status.json using the service name as the hostname.
The main stanza above only adds a dependency. You can omit it when you have no overrides. To use a prebuilt main image, set [environment].docker_image in task.toml.
Images, files, and configuration
Images are resolved during dataset import. Runtime tasks use the recorded images. Task files and image-build inputs are not a secret store; use job secrets for agent credentials.
Configuration that import rejects
Configuration that import rejects
includeand serviceextends, which can introduce unseen service images.- Interpolated image names, untagged images, and an unpinned
:latesttag. - Build options such as
ssh,secrets, additional contexts, and inline Dockerfiles. - A build context outside the task, or a Dockerfile outside its build context.
main.buildtogether with[environment].docker_image, or conflicting main image declarations.
Provider and task limits
Compose tasks run on E2B or Daytona. They do not support Modal,no-network, GPUs, or multi-step execution. Sandbox capabilities describes provider selection and other network restrictions.
Score service state
A verifier may need more than files frommain: a request log, a database export, or an in-memory counter. Use collection hooks and service artifacts to save that evidence before verification.
