Skip to main content
Agentgateway ships a minimal, production-ready container image built on the Chainguard glibc-dynamic base image. A Dockerfile.windows is also provided for Windows containers.

Pre-built images

Pre-built images are published to the GitHub Container Registry:

Building the image

The default Dockerfile uses a multi-stage build. It builds the UI with Node, compiles the Rust binary (optionally with musl for a fully static binary), and copies only the final binary into the minimal runtime image.
This is equivalent to:

Dockerfile walkthrough

The Linux Dockerfile has four stages:
Dockerfile
Key points:
  • Build caches for npm and Cargo registries are mounted as --mount=type=cache to keep iterative builds fast.
  • The runtime image is cgr.dev/chainguard/glibc-dynamic — a distroless image with no shell, minimal attack surface, and regular security updates.
  • VERSION and GIT_REVISION build args are embedded in the binary. The build fails if version information is missing (the --version output must not contain "unknown").

Running with Docker

Mount a configuration file

Pass your configuration file into the container as a bind mount and point the binary to it with -f:

Port mappings

The listener port (default 8080) is defined in your configuration file, not hard-coded. Adjust the -p flag to match whatever port you configure.

Volume mounts

Environment variable configuration

You can override individual settings without modifying the config file by passing environment variables:

Docker Compose examples

Agentgateway with telemetry

The repository includes a docker-compose.yaml in examples/telemetry/ that adds Jaeger and an OpenTelemetry collector alongside Agentgateway:
examples/telemetry/docker-compose.yaml
To run Agentgateway alongside these services, add a service entry pointing to the OTLP endpoint in your config:
config.yaml

Agentgateway with an OpenAPI backend

The examples/openapi/docker-compose.yaml shows a petstore backend service running alongside the gateway:
examples/openapi/docker-compose.yaml

Health checks

Add a Docker health check so that container orchestrators can detect when Agentgateway is ready:
docker-compose.yaml
The Chainguard runtime image has no shell. Use wget or curl (if present) for health check commands, or prefer a TCP-based check. Do not use sh -c or bash-based health checks.

Windows containers

A Dockerfile.windows is provided for environments that require native Windows containers. It uses Windows Server Core (ltsc2022) as the build image and Nano Server as the runtime:
Dockerfile.windows
Build and run: