Docker image guide

Your Docker image is the unit HyperOptimizer runs for each trial. It should contain your workload, dependencies, and a default command that runs one evaluation.

Image requirements

  • The default command runs one trial and exits.
  • The command accepts extra --hpo-* arguments.
  • Dependencies are installed during the image build.
  • Data access is configured through files, mounted volumes, or environment.
  • Metrics are printed to stdout before the process exits.

Example Dockerfile

FROM python:3.12-slim

WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

CMD ["python", "main.py"]

HyperOptimizer can then append trial parameters:

python main.py --hpo-lookback-window=50 --hpo-risk-multiplier=1.4

Runtime tips

Keep images reproducible

Pin dependency versions so trial results are comparable over time.

Avoid hidden local state

Do not rely on files that only exist on your laptop. Put required assets in the image or configure access explicitly.

Fail clearly

Print enough logs to debug bad parameter sets and exit non-zero for real failures.

Next, parse the CLI parameters.

Was this page helpful?