The BYOD feature allows customers to use custom Docker images that extend the base coder-eval-agent image, enabling them to add custom dependencies and tools while maintaining the latest coder-eval codebase.
By default, coder-eval uses the official coder-eval-agent image built via make docker-image. With BYOD, you can:
- Extend the base image with custom dependencies
- Override the image tag in your task configuration
- Run evaluations with your custom image while leveraging all coder-eval features
DockerDriverConfig.imagefield now defaults toDEFAULT_IMAGE_TAG(e.g.,coder-eval-agent:0.1.0)- No environment variable override needed—use task configuration instead
- Simple precedence: Task config → Default image
Create a Dockerfile in your repo:
FROM coder-eval-agent:0.1.0
# Install custom dependencies
RUN apt-get update && apt-get install -y \
custom-tool \
another-dependency \
&& rm -rf /var/lib/apt/lists/*
# Add custom scripts or configuration
COPY custom-script.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/custom-script.shBuild the image:
docker build -t my-custom-image:0.1.0 .Update your task YAML to reference the custom image:
task_id: my_task
description: Task using custom Docker image
sandbox:
driver: docker
docker:
image: my-custom-image:0.1.0 # Your custom image
network: bridge
limits:
timeout: 300
initial_prompt: |
Use the custom tools installed in my-custom-image to complete this task.
success_criteria:
- type: file_exists
path: output.txt
description: Verify output file was createdThe codebase includes a smoke test that demonstrates BYOD:
Task: tasks/byod_smoke_test.yaml
- Uses custom image
byod-custom-image:0.1.0 - Verifies the custom image was loaded via a marker file
- Tagged
smoke-passfor CI/CD pipeline
Template: templates/byod_smoke_test/Dockerfile
- Extends
coder-eval-agent:0.1.0 - Adds
/opt/byod_markerto prove custom image was used
Run locally:
# Build the custom image
docker build -t byod-custom-image:0.1.0 templates/byod_smoke_test/
# Run the smoke test
set -a && source .env && set +a
coder-eval run tasks/byod_smoke_test.yaml- Type:
str(not optional) - Default:
DEFAULT_IMAGE_TAG(e.g.,coder-eval-agent:0.1.0) - Override: Set in task YAML via
sandbox.docker.image
# Default (no override)
sandbox:
driver: docker
# image defaults to coder-eval-agent:0.1.0
# Override at task level
sandbox:
driver: docker
docker:
image: my-team/image:latest
# Override via CLI (future enhancement)
# coder-eval run task.yaml --docker-image custom:v1-
Base image consistency: Always extend from the same
coder-eval-agentversion as your hostFROM coder-eval-agent:0.1.0 # Match your host version -
Keep images lean: Add only necessary dependencies
# Good: Clean up after install RUN apt-get update && apt-get install -y tool && rm -rf /var/lib/apt/lists/* # Avoid: Large intermediate layers RUN apt-get update RUN apt-get install -y tool
-
Document custom tools: Make it clear what you added
# Custom tools added for project X # - tool-a: used for step 1 # - tool-b: used for step 2 RUN apt-get install -y tool-a tool-b
-
Version your images: Use semver tags
docker build -t my-company/evaluation-agent:1.0.0 . docker build -t my-company/evaluation-agent:latest .
-
Test locally first: Verify your image works before adding to CI
docker build -t test-image:local . coder-eval run task.yaml # Ensure task.yaml points to test-image:local
Error: docker: Error response from daemon: pull access denied
Solution: Ensure the image exists and the tag is correct
# List available images
docker images | grep byod
# Rebuild if missing
docker build -t byod-custom-image:0.1.0 templates/byod_smoke_test/Warning: Image coder-eval-agent:0.1.0 != host 0.1.0
Solution: Rebuild the custom image after updating the base image
# Update base image
make docker-image
# Rebuild custom image
docker build --no-cache -t my-image:0.1.0 .The BYOD feature is tested in the smoke-pass bucket of the e2e-smoke job:
- Base image is built:
make docker-image - BYOD template is built:
docker build templates/byod_smoke_test/ - Smoke test runs:
coder-eval run tasks/*.yaml --tags smoke-pass - Results verified:
byod_smoke_testshould succeed
See .github/workflows/pr-checks.yml for the full pipeline.
- Implementation:
src/coder_eval/models/sandbox.py(DockerDriverConfig) - Runner:
src/coder_eval/isolation/docker_runner.py(image selection) - Tests:
tests/test_byod_feature.py - Example Task:
tasks/byod_smoke_test.yaml - Example Dockerfile:
templates/byod_smoke_test/Dockerfile - CI/CD:
.github/workflows/pr-checks.yml(e2e-smoke, windows-smoke jobs)