languages | products | page_type | name | urlFragment | description | ||||
---|---|---|---|---|---|---|---|---|---|
|
|
sample |
.NET Aspire Container Build Sample |
aspire-container-build |
An example of integrating apps written in other languages using container-based builds in a .NET Aspire app. |
This sample demonstrates integrating applications into a .NET Aspire app via Dockerfiles and container-based builds. This is especially helpful to integrate applications written in languages that .NET Aspire does not have a native integration for, or to reduce the prerequisites required to run the application.
The sample integrates a simple app written using Go and the Gin Web Framework by using a Dockerfile:
- ginapp: This is a simple "Hello, World" HTTP API that returns a JSON object like
{ "message": "Hello, World!" }
from/
.
- .NET 8 SDK
- A container runtime supported by .NET Aspire, e.g. Docker Desktop or Podman
- Optional Visual Studio 2022 17.12
If using Visual Studio, open the solution file ContainerBuild.sln
and launch/debug the ContainerBuild.AppHost
project.
If using the .NET CLI, run dotnet run
from the ContainerBuild.AppHost
directory.
From the Aspire dashboard, click on the endpoint URL for the ginapp
resource to see the response in the browser.