Loading repository data…
Loading repository data…
ppiova / repository
Docker-first starter for Microsoft Agent Framework: multi-stage Dockerfile, devcontainer, Codespaces-ready single-agent sample with Azure OpenAI.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
Docker-first starter for building AI agents with Microsoft Agent Framework on .NET 8 and Azure OpenAI.
Part of a series of Docker-first samples for Microsoft Agent Framework:
agent-framework-devcontainer·mcp-docker-starter·ai-agents-compose-stack
| Problem running agents locally | What this starter gives you |
|---|---|
| "Works on my machine" env drift | Reproducible image, same across team |
| Onboarding takes hours | docker compose up — done |
| Hard to share with non-.NET teammates | Anyone with Docker can run it |
| Messy auth setup | Key-based or Azure AD, both supported |
| Hard to deploy to Azure / K8s later | Same image deploys anywhere |
gpt-4o-mini)No .NET SDK needed on your host — the build runs inside the container.
Pre-built multi-arch images (linux/amd64 + linux/arm64) with SBOM and build provenance attestations are published to GHCR on every push to main.
docker pull ghcr.io/ppiova/agent-framework-devcontainer:latest
docker run --rm --env-file .env ghcr.io/ppiova/agent-framework-devcontainer:latest "Tu prompt"
Pin to an immutable digest for production:
docker pull ghcr.io/ppiova/agent-framework-devcontainer@sha256:<digest>
Or reference it directly from compose.yaml:
services:
agent:
image: ghcr.io/ppiova/agent-framework-devcontainer:latest
env_file: [.env]
git clone https://github.com/ppiova/agent-framework-devcontainer.git
cd agent-framework-devcontainer
cp .env.example .env
Edit .env with your Azure OpenAI values:
AZURE_OPENAI_ENDPOINT=https://<your-resource>.openai.azure.com
AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o-mini
AZURE_OPENAI_API_KEY=<your-key> # optional — see "Auth modes" below
docker compose up --build
You should see the agent respond in streaming:
🤖 [DockerDemoAgent] ejecutándose en contenedor
📍 Endpoint: https://...
🧠 Deployment: gpt-4o-mini
🔑 Auth: API Key
> Prompt: Preséntate en una frase y explicá por qué conviene...
--- Respuesta (streaming) ---
¡Hola! Soy DockerDemoAgent, un agente corriendo en un contenedor...
------------------------------
docker compose run --rm agent "Dame 3 razones para usar Docker al desplegar agentes de IA"
Or with plain Docker:
docker build -t agent-starter .
docker run --rm --env-file .env agent-starter "¿Qué es un multi-agent workflow?"
Open the repo in VS Code → "Reopen in Container", or click Open in Codespaces at the top of this README.
You get:
dotnet restore runs automatically on createOnce inside the container:
az login # if using Azure AD auth
dotnet run --project src
The agent resolves credentials in this order:
AZURE_OPENAI_API_KEY — if present, use key-based auth (simplest inside Docker).AzureCliCredential — works in the Dev Container after az login.DefaultAzureCredential — works with environment variables (AZURE_CLIENT_ID/AZURE_TENANT_ID/AZURE_CLIENT_SECRET) or Managed Identity when deployed to Azure (App Service, Container Apps, AKS).This means the same image runs locally, in CI, and in production — only the credential source changes.
.
├── .devcontainer/
│ └── devcontainer.json # Codespaces / VS Code Dev Container config
├── src/
│ ├── AgentStarter.csproj # Microsoft.Agents.AI + Azure.AI.OpenAI
│ └── Program.cs # Minimal streaming agent
├── .dockerignore
├── .env.example
├── .gitignore
├── compose.yaml # Compose orchestration + env loading
├── Dockerfile # Multi-stage Alpine build, non-root user
└── README.md
mcr.microsoft.com/dotnet/sdk:8.0-alpine for build, mcr.microsoft.com/dotnet/runtime:8.0-alpine for runtime — final image stays under ~100 MB.csproj is restored before copying source, so source-only changes skip the restore layer.agent) — OWASP / CIS hardening baseline.UseAppHost=false + dotnet EntryPoint — smaller, faster startup..dockerignore excludes bin/, obj/, .git/, .env from the build context.This is intentionally minimal so you can build on it:
[Description]-annotated methods registered in CreateAIAgent)AgentThreadMicrosoft.Extensions.AI)For multi-agent + observability patterns, see ai-agents-compose-stack.
For containerized MCP integrations, see mcp-docker-starter.
MIT — by Pablo Piovano · Microsoft MVP in AI.