Skip to content

Run it in a container

For schedulers that run containers: GitLab CI, Airflow, a Kubernetes CronJob, an ECS scheduled task. On your own machine, the uv install is simpler.

From v0.3.0 on, each release is published to GitHub’s registry, tagged with its version without the v (v0.3.0 is 0.3.0):

Terminal window
docker pull ghcr.io/jlcoto/honest-agent:<version>

Pin the version you tested, as with uv add. The image has Python, honest-agent and uv, so MCP servers started with uvx work as they do on your machine. It’s built for linux/amd64 and linux/arm64 (the 0.3.0 image is amd64 only: on Apple Silicon, add --platform linux/amd64 to docker run). Its entrypoint is honest-agent: anything after the image name is the command, like run or report.

To build it yourself, from a clone of the repository:

Terminal window
docker build -t honest-agent cli

honest-agent looks for honest_agent_config.yml and .env from the folder it runs in, and in the image that’s /project. Mount your project there:

Terminal window
docker run --rm -v "$PWD:/project" ghcr.io/jlcoto/honest-agent:<version> run

A few things about it:

  • .env is optional. In a scheduler, pass the API keys and tokens as environment variables from its secret store (-e ANTHROPIC_API_KEY, a Kubernetes Secret, …). Variables already set win over .env. Don’t use Docker’s --env-file .env: it keeps quotes as part of the value, where .env strips them.
  • A local mcp_command runs inside the container, in the folder of honest_agent_config.yml, so every path in it must exist there. A project made with init --example on your machine has your machine’s Python in it: run init --example in the container instead.
  • The results file is in the mounted folder (honest_agent_results/ by default). A scheduler throws the container away after each run, so keep the results somewhere that lasts: MotherDuck, or a file you copy in and out as in Store results in S3. The image has no AWS CLI: add it in your own image (below), or copy the file in a step before and after.
  • The container runs as a normal user (honest, id 1000), not as root, so on Linux the files it writes belong to id 1000. If that isn’t your id (id -u says), add --user "$(id -u):$(id -g)" -e HOME=/tmp and the files are yours (uvx needs a home folder it can write to).

A scheduler has its own place for the image, the mount and the variables, so it needs nothing from this section. If you run the container by hand often, a compose.yml next to honest_agent_config.yml saves retyping them:

services:
honest-agent:
image: ghcr.io/jlcoto/honest-agent:<version>
volumes:
- .:/project
env_file: .env

Then the command is the same as on your machine, after docker compose run --rm honest-agent:

Terminal window
docker compose run --rm honest-agent run
docker compose run --rm honest-agent report

Compose reads .env the way honest-agent does (double quotes around a value are stripped), so the --env-file caveat above doesn’t apply. The file is a convenience for one machine: don’t commit it with anything but the image version in it.

report writes the report into the mounted folder, like on your machine:

Terminal window
docker run --rm -v "$PWD:/project" ghcr.io/jlcoto/honest-agent:<version> report

serve only answers on 127.0.0.1, and inside a container that’s the container itself, so publishing a port (-p 8000:8000) doesn’t reach it. On Linux, share the machine’s network instead:

Terminal window
docker run --rm --network host -v "$PWD:/project" ghcr.io/jlcoto/honest-agent:<version> serve --no-open-browser

Then open http://127.0.0.1:8000/. Elsewhere, run serve outside the container, from the project folder:

Terminal window
uvx --from "git+https://github.com/jlcoto/the_honest_agent@<tag>#subdirectory=cli" honest-agent serve

For a team, host the report behind a sign-in instead: see Running it for a team.

The image has what honest-agent and uvx need, nothing more. If your MCP server needs Node.js, extra Python packages or another tool, build your own image from this one:

FROM ghcr.io/jlcoto/honest-agent:<version>
# The image runs as the user `honest`; installing needs root, so switch and switch back.
USER root
# Node.js, for MCP servers started with npx (Debian's version: check it's new enough
# for your server).
RUN apt-get update \
&& apt-get install -y --no-install-recommends nodejs npm \
&& rm -rf /var/lib/apt/lists/*
# A server published as a Python package, installed once instead of on every run.
# mcp_command is then just its name.
ENV UV_TOOL_DIR=/opt/uv-tools UV_TOOL_BIN_DIR=/usr/local/bin
RUN uv tool install <server-package>
# A server script of your own, with its packages in a separate environment so they
# can't clash with honest-agent's. mcp_command: "/opt/mcp/bin/python mcp_server/server.py"
RUN uv venv /opt/mcp && uv pip install --python /opt/mcp/bin/python <packages>
USER honest

The local server gets only PATH, HOME and a few other basics, plus the variables in the target’s mcp_env. An ENV you add for the server reaches it only once its name is in mcp_env.

Made by Jose CotoLinkedInSubstackPrivacy