liveBook · Manning

Docker

As explained in AI Agents in Action, Second Edition

Docker is a platform for building, packaging, distributing, and running applications in containers.

Docker packages an application, its runtime, and dependencies into a container that can run consistently across environments. For agent systems, one focused agent commonly runs per container, making services easier to replace, scale, and version. section 8.2 section 8.6

Use Docker as the deployment layer around agent services:

  • Separate concerns by placing the frontend, worker agents, and tool services in distinct containers. section 8.2
  • Expose a containerized agent through an API or run it as an MCP server. section 8.2
  • Use Docker Desktop for local hosting; use Compose to start a multi-agent stack with one command. section 8.2 section 8.6
  • Move to Kubernetes or cloud container services when greater enterprise scale is required. section 8.2

Containerize an image API

Build an image-generator container, run it on a host port, and pass the API key through an environment variable. Then stop and rerun it with a name so Docker Desktop can manage the container and display its logs. section 8.5

Figure 8.4 There are several ways a frontend agent may consume containerized microservice agents: as tools through an API or as MCP servers.

Shows how a browser-based frontend agent can consume specialized containerized agents through APIs or MCP servers. section 8.2

How AI Agents in Action, Second Edition covers it

How deep it goes
Explains container boundaries, local operation, and Compose orchestration, but defers Kubernetes and broader cloud deployment.
Examples
Uses an image-generator API, Dockerfile, Docker build and run commands, Docker Desktop logs, and a Compose stack.
What it assumes
Assumes a running agent API and an available Dockerfile, while practicing container build, execution, and orchestration.
What you can do after
Operate/configure agent containers, inspect logs, and launch coordinated services with Docker Compose.
How it connects
Connects containers with microservices, APIs, MCP servers, Docker Compose, Docker Desktop, and Kubernetes.

Also explained in

Compare how 26 books explain Docker →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI Agents in Action, Second Edition. The section links point to the parts of the book it draws on.