hud build command builds your Docker image, analyzes its MCP server, and writes a reproducible hud.lock.yaml.
Usage
Arguments
Environment directory containing Dockerfile and pyproject.toml
Options
Docker image tag to use. Defaults to
[tool.hud.image] or {dir}:dev.Build without using Docker cache
Show detailed build output. Short:
-vTarget platform for Docker build. Defaults to
linux/amd64 if unspecified.What It Does
1
Build Docker Image
Runs
docker build (twice): a temporary build for analysis, then a labeled build for the final image and version tags.2
Analyze Environment
Runs the container via MCP to measure initialize time and list tools (count and input schemas).
3
Generate Lock File
Writes
hud.lock.yaml with:version: lock format versionimage:{tag}@sha256:<id>after final buildbuild: generatedAt, hudVersion, directory, internalversion(semver, auto‑incremented),sourceHash, optionalsourceFilesenvironment: initializeMs, toolCount, and optionalvariableswithprovided,required,optionaltools: name, description, inputSchema (for RL/evals tooling)
4
Retag & Label
Adds labels (
org.hud.*) and tags the image with both the chosen tag and the internal version.Examples
Image Naming
If--tag is not provided:
- Read
[tool.hud.image]frompyproject.toml - Otherwise use
{directory-name}:dev
Environment Variables
Pass runtime environment variables during analysis with-e/--env flags:
environment.variables.provided; missing required variables are listed in environment.variables.required.