`mlflow models build-docker`

A reproducible image of model + env + server, ready for any registry.

0/1 done

Docker is the contract

One artefact, anywhere

mlflow models build-docker \
  -m 'models:/credit-scoring/Production' \
  -n credit-scoring:latest

What you get is a self-contained image with the model, its Python environment, the MLflow scoring server, and a documented /invocations endpoint. Push it to ECR/GCR/ACR and you can run it on ECS, GKE, AKS, Kubernetes, Cloud Run — anywhere.

Production checklist

  • Pin the base image (--base-image python:3.11-slim).
  • Run as non-root (USER 1000).
  • Add a readiness probe on /ping, liveness on /health.
  • Set resource requests/limits — model memory is sticky.
  • Log to STDOUT only; the platform aggregates.

Analogy

Building a model image is canning a stew. The cook is gone but anyone with a can opener can heat it up identically two years later. The label (image tag) tells you which recipe, the can (image hash) makes sure nobody swapped the contents.

Reading in progress · 0 of 1 activity done