Docker Compose for AI

Docker Compose now treats AI models as first-class application components via a top-level `models:` element, so you can wire models, agents, and tools into one declarative file and bring them up with a single `docker compose up`. The required field is `model:` (the OCI artifact pulled and run by Doc

Canonical version: Docker Compose for AI.

Docker Compose now treats AI models as first-class application components via a top-level models: element, so you can wire models, agents, and tools into one declarative file and bring them up with a single docker compose up. The required field is model: (the OCI artifact pulled and run by Docker Model Runner); optional fields are context_size: and runtime_flags:. Services reference models and Compose injects connection env vars (short syntax auto-generates LLM_URL and LLM_MODEL; long syntax uses endpoint_var / model_var).

models:
  llm:
    model: ai/smollm2
    context_size: 8192
services:
  app:
    image: my-app
    models:
      - llm

It is the assembly layer of Docker AI: it ties Docker Model Runner and the Docker MCP Gateway into agentic apps, and the spec is portable across Compose-compliant platforms.

References


About Sébastien

I'm Sébastien Dubois, and I'm on a mission to help knowledge workers escape information overload. After 20+ years in IT and seeing too many brilliant minds drowning in digital chaos, I've decided to help people build systems that actually work. Through the Knowii Community, my courses, products & services and my Website/Newsletter, I share practical and battle-tested systems.

I write about Knowledge Work, Personal Knowledge Management, Note-taking, Lifelong Learning, Personal Organization, Productivity, and more. I also craft lovely digital products and tools.

If you want to follow my work, then become a member and join our community.

Ready to get to the next level?

If you're tired of information overwhelm and ready to build a reliable knowledge system:

Found this valuable? Share it with someone who needs it.

Join 6,000+ readers. Get practical systems for knowledge & AI. Free.

Subscribe ✨

Free: Knowledge System Checklist

A clear roadmap to building your own knowledge system. Subscribe and get it straight to your inbox.

6,000+ readers. No spam. Unsubscribe anytime.