Aspire.Hosting.Docker
17.0.0
Prefix Reserved
dotnet add package Aspire.Hosting.Docker --version 17.0.0
NuGet\Install-Package Aspire.Hosting.Docker -Version 17.0.0
<PackageReference Include="Aspire.Hosting.Docker" Version="17.0.0" />
<PackageVersion Include="Aspire.Hosting.Docker" Version="17.0.0" />
<PackageReference Include="Aspire.Hosting.Docker" />
paket add Aspire.Hosting.Docker --version 17.0.0
#r "nuget: Aspire.Hosting.Docker, 17.0.0"
#:package Aspire.Hosting.Docker@17.0.0
#addin nuget:?package=Aspire.Hosting.Docker&version=17.0.0
#tool nuget:?package=Aspire.Hosting.Docker&version=17.0.0
Docker hosting integration
Provides publishing extensions to Aspire for Docker Compose.
Getting started
Add the integration
From your AppHost directory, add the Aspire.Hosting.Docker integration with the Aspire CLI:
aspire add Aspire.Hosting.Docker
aspire add Aspire.Hosting.Dotnet
Usage example
In the AppHost, add the environment:
C#
builder.AddDockerComposeEnvironment("compose");
TypeScript
await builder.addDockerComposeEnvironment("compose");
The dashboard container included in the published Compose file opts out of dashboard usage and error telemetry by default (ASPIRE_DASHBOARD_TELEMETRY_OPTOUT=true). This does not affect the application's OpenTelemetry data sent to the dashboard.
Browser-origin endpoint properties use overridable deployment inputs because a Compose service address does not identify its public browser address.
For example, frontend.GetEndpoint("http").BrowserOrigins reads Parameters:frontend-http-BrowserOrigins when preparing deployment.
The input accepts a comma-separated origin list; local URL customization is unchanged.
frontend.GetEndpoint("http").PrimaryBrowserOrigin uses a separate Parameters:frontend-http-PrimaryBrowserOrigin input containing a single origin, with the same localhost default rules.
External HTTP endpoints with an explicit published port default to http://localhost:<published-port> (or HTTPS for an HTTPS endpoint), not the service's container port.
External HTTP(S) endpoints without a known published port require an explicit input. Internal and non-HTTP(S) endpoint references are rejected.
Generated input names include a stable suffix for hyphenated endpoint names so different resource/endpoint combinations cannot share an input.
Volumes
Use an environment variable so projects and executables can use a local Aspire store directory while Docker Compose mounts the published named volume:
C#
builder.AddDotnetProject("api", "../Api/Api.csproj")
.WithVolume("data", "/data", env: "DATA_PATH");
TypeScript
const api = await builder.addNodeApp("api", "../api", "server.js");
await api.withVolume("/data", "data", "DATA_PATH");
In run mode, projects and executables receive a workload-scoped directory through DATA_PATH. Containers receive /data and use a local container volume. Named storage is preserved independently of resource lifetime: session resources stop with the AppHost and reuse their storage on the next run, while persistent resources can keep the compute instance alive. In the generated Compose service, all compute resource types receive /data and a named volume mounted at that path.
Docker Compose creates the named volume owned by root, so a service published as a non-root image cannot write to the mount without extra configuration. Aspire does not yet generate that configuration, so today the service has to run as a user that can write to the volume. Docker only seeds a named volume's contents and ownership from the image when the volume is empty, so pre-creating the target directory in your image fixes only the first run and has no effect once the volume holds data — which is exactly the reuse case described above. Tracked by #19422.
aspire publish -o docker-compose-artifacts
Additional documentation
https://aspire.dev/integrations/gallery/ https://aspire.dev/integrations/compute/docker/
Feedback & contributing
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Aspire.Hosting (>= 17.0.0)
- AspNetCore.HealthChecks.Uris (>= 9.0.0)
- Google.Protobuf (>= 3.36.1)
- Grpc.AspNetCore (>= 2.83.0)
- Grpc.Net.ClientFactory (>= 2.83.0)
- Grpc.Tools (>= 2.83.0)
- Hex1b (>= 0.173.0)
- KubernetesClient (>= 19.0.2)
- MessagePack (>= 2.5.307)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Configuration.Binder (>= 10.0.15)
- Microsoft.Extensions.Configuration.EnvironmentVariables (>= 10.0.15)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 10.0.15)
- Microsoft.Extensions.FileSystemGlobbing (>= 10.0.15)
- Microsoft.Extensions.Hosting (>= 10.0.15)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Http (>= 10.0.15)
- Microsoft.Extensions.Logging (>= 10.0.15)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.15)
- Microsoft.Extensions.Options (>= 10.0.15)
- Microsoft.Extensions.Primitives (>= 10.0.15)
- ModelContextProtocol (>= 1.4.1)
- Newtonsoft.Json (>= 13.0.4)
- OpenTelemetry.Exporter.OpenTelemetryProtocol (>= 1.18.0)
- OpenTelemetry.Extensions.Hosting (>= 1.18.0)
- Polly.Core (>= 8.7.0)
- Semver (>= 3.0.0)
- StreamJsonRpc (>= 2.25.29)
- System.IO.Hashing (>= 10.0.15)
- YamlDotNet (>= 18.1.0)
NuGet packages (20)
Showing the top 5 NuGet packages that depend on Aspire.Hosting.Docker:
| Package | Downloads |
|---|---|
|
Nextended.Aspire.Hosting.Supabase
This Library provides an Aspire Supabase solution |
|
|
Shirubasoft.Aspire.CloudflareTunnels
Cloudflare Tunnel and Quick Tunnel resources for Aspire AppHosts. |
|
|
Coworkee.Aspire
AddCoworkeeApp() for the Aspire app host: migrations, auth server, APIs, workers and web wired with Postgres (or SQL Server, SQLite), Redis, Mailpit, Elasticsearch and Keycloak. |
|
|
Nextended.Aspire.Hosting.N8n
This Library provides an Aspire n8n workflow automation solution |
|
|
CosmicChimps.Aspire.Hosting.Dokploy
Dokploy deployment integration for Aspire — deploys each Aspire service as an individual Dokploy application or native managed resource (Redis, PostgreSQL, MySQL, MariaDB, MongoDB). |
GitHub repositories (10)
Showing the top 10 popular GitHub repositories that depend on Aspire.Hosting.Docker:
| Repository | Stars |
|---|---|
|
meysamhadeli/booking-microservices
A practical microservices with the latest technologies and architectures like Vertical Slice Architecture, Event Sourcing, CQRS, DDD, gRpc, MongoDB, RabbitMq, Wolverine, and Aspire in .Net 10.
|
|
|
microsoft/aspire-samples
Browse the sample apps demonstrating Aspire integration across C#, JavaScript, TypeScript, Python, Go, containers, databases, cloud, AI, and observability scenarios.
|
|
|
mehdihadeli/food-delivery-microservices
🍔 A practical and cloud-native food delivery microservices, built with .Net Aspire, .Net 10, Wolverine, Domain-Driven Design, CQRS, Vertical Slice Architecture, Event-Driven Architecture, and the latest technologies.
|
|
|
NexusForever/NexusForever
An emulator for the defunct MMORPG WildStar which supports build 16042 (Final Patch)
|
|
|
meysamhadeli/booking-modular-monolith
A practical Modular Monolith architecture with the latest technologies and architecture like Vertical Slice Architecture, Event Driven Architecture, CQRS, DDD, gRpc, Wolverine, and Aspire in .Net 10.
|
|
|
evangelosvlachos96-dotcom/booking-microservices
Flight booking system built as .NET 10 microservices with Vertical Slice Architecture, DDD, CQRS, Event Sourcing, gRPC, RabbitMQ, Wolverine, PostgreSQL, MongoDB and .NET Aspire.
|
|
|
davidfowl/aspire-ai-chat-demo
Aspire AI Chat is a full-stack chat sample that combines modern technologies to deliver a ChatGPT-like experience.
|
|
|
suxrobGM/logistics-app
AI-powered fleet management platform with an agentic dispatcher that matches loads to trucks, ensures HOS compliance, and optimizes routes. Built for trucking companies.
|
|
|
nightscout/nocturne
A next-generation platform for diabetes management
|
|
|
davidfowl/aspire-ssh-deploy
An extension of the docker compose integration for deploying to a docker host via SSH
|
| Version | Downloads | Last Updated |
|---|---|---|
| 17.0.0 | 7,596 | 11/18/2026 |
| 13.6.5 | 41,170 | 11/10/2026 |
| 13.6.4 | 47,660 | 10/24/2026 |
| 13.6.3 | 10,131 | 10/21/2026 |
| 13.6.2 | 4,814 | 10/20/2026 |
| 13.6.1 | 49,483 | 10/7/2026 |
| 13.6.0 | 26,512 | 9/29/2026 |
| 13.5.4 | 53,358 | 9/15/2026 |
| 13.5.3 | 54,105 | 8/25/2026 |
| 13.5.2 | 12,969 | 8/21/2026 |
| 13.5.1 | 3,069 | 8/20/2026 |
| 13.5.0 | 12,066 | 8/18/2026 |
| 13.4.6 | 156,001 | 6/19/2026 |
| 13.4.5 | 16,512 | 6/17/2026 |
| 13.4.4 | 18,031 | 6/15/2026 |
| 13.4.3 | 16,450 | 6/8/2026 |
| 13.4.2 | 7,703 | 6/3/2026 |
| 13.4.1 | 947 | 6/3/2026 |
| 13.4.0 | 14,839 | 6/1/2026 |
| 13.3.5 | 24,041 | 5/21/2026 |