> ## Documentation Index
> Fetch the complete documentation index at: https://agent-compass.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Docker

Run Docker on the machine that starts AgentCompass and make sure the current user can access its daemon. The task image must contain the commands and dependencies required by the Benchmark and Harness.

## Configure

```bash theme={"system"}
agentcompass run <benchmark> <harness> "$MODEL_NAME" \
  --env docker \
  --env-params '{"setup":{"image":"python:3.13-slim"},"platform":"linux/amd64"}'
```

## Provider Params

Every provider accepts the [common Environment schema](https://agent-compass.mintlify.site/en/user_guide/modules/environments/configuration/overview.md) plus its own declared provider options. Use the command below to list all accepted keys. Pass provider options alongside shared fields in `--env-params` or the flat YAML provider section. Image, resources, outbound policy, and environment variables retain their unified entry points; native aliases and unknown keys are rejected.

```bash theme={"system"}
agentcompass config docs env docker
```

Use `resources`, `run_resources`, and `evaluation_resources`. Provider capabilities still differ: unsupported requirements fail explicitly, while storage limits follow the documented provider support policy. See [Resource Limits](https://agent-compass.mintlify.site/en/user_guide/modules/environments/configuration/resource_limits.md).

## Provider Behavior

Supports registry images, local `setup.dockerfile` builds, working directories, startup commands, and dynamic outbound policies. Normal cleanup removes the task container; `--keep-environment` retains it.

Use `setup.workdir` for the default command directory and `setup.build_timeout_seconds` for environment creation. The Benchmark selects the task workspace independently through its prepared input; neither setting replaces that workspace or an individual command timeout.

## Compose Image Reuse and Cleanup

Services with `build` and no explicit `image` receive an image name in this form, normalized to lowercase characters accepted by Docker:

```text theme={"system"}
ac-<benchmark>-<task>-<service>:<build-fingerprint>
```

Single-container images built from `setup.dockerfile` are named `ac-<benchmark>-<task>:<build-fingerprint>` and use the Dockerfile's directory as the context; fingerprinting, reuse, file locking, and `delete_images` cleanup follow the rules below.

The fingerprint covers build settings after Compose merging and variable interpolation (including `build.args` and `build.network`), the platform, Dockerfile, context contents, permissions, symlinks, and empty directories. Modification times are excluded. Like Harbor, hashing conservatively scans the entire context without applying `.dockerignore`; changing an ignored file can produce a new tag. Execution and fresh verifier images use their respective build inputs. Containers, networks, and volumes remain isolated by project.

An image with a matching fingerprint on the same Docker daemon skips the build. File locks prevent duplicate builds during concurrent starts. Explicit `image` names are preserved, and images are retained by default. Remote contexts, additional contexts, secrets, and SSH builds still run through Compose/BuildKit on each start. Cache hits do not recheck mutable base images or remote packages. To refresh a build, set `build.pull: true` through `compose_override`; also set `build.no_cache: true` to bypass build-layer caching.

Set the Docker parameter `delete_images: true` to remove automatically named image tags used by the session when it closes, including reused cache images:

```bash theme={"system"}
agentcompass run terminal_bench_4 terminus2 "$MODEL_NAME" \
  --env docker --env-params '{"delete_images":true}' \
  --benchmark-params '{"sample_ids":["kv-live-surgery"]}' \
  --model-base-url "$MODEL_BASE_URL" \
  --model-api-key "$MODEL_API_KEY"
```

The default is `false`. Cleanup releases containers first and retains images still used by other running or stopped containers. It does not remove explicitly named images, pulled base images, or the global BuildKit cache, and never forces removal or runs prune. `--keep-environment` retains both containers and images. Failed cleanup can be retried with `agentcompass env close`.

## Compose Network Policies

With `setup.compose_file`, Docker Compose supports `public`, `no-network`, `allowlist`, `denylist`, and phase changes, including fresh evaluation environments. Configure the shared [network policy fields](https://agent-compass.mintlify.site/en/user_guide/modules/environments/configuration/network.md); no separate Compose switch is required.

`no-network` closes external egress for the service group while preserving communication and name resolution between services. Restricted phases use project-owned internal bridge networks. Returning to `public` restores egress for services that originally had external access. Services connected only to internal networks, or using `network_mode: none`, remain isolated.

`allowlist` and `denylist` use the existing egress proxy. Services receive proxy environment variables, with service names and network aliases added to `NO_PROXY`. Applications must support HTTP/HTTPS CONNECT proxies; arbitrary direct TCP/UDP connections are blocked. Policy changes close existing proxy tunnels, and failed changes release the entire environment. Image pulls and builds run through the trusted Docker daemon, outside service egress policies.

Controlled services with external access must share at least one project-owned bridge network. Host/container network modes, external networks, custom fixed network names or driver options, privileged containers, `NET_ADMIN`/`SYS_ADMIN`, host devices, and Docker socket mounts are rejected. Validation runs after merging `compose_override`, so overrides cannot bypass these restrictions.

Restricted phases also reject `network_mode: service:…`, non-bridge drivers, `cap_add: [ALL]`, host PID/IPC namespaces, control-plane path mounts, and the reserved `agentcompass_public`/`agentcompass_proxy` network names. `ctr-optimization` and `nextjs-performance` share service network namespaces and cannot run in restricted native Docker phases.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.