Skip to content

Latest commit

 

History

History

ContainerBuild

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
languages products page_type name urlFragment description
csharp
go
dotnet
dotnet-aspire
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.

Working with container-built resources in a .NET Aspire application

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.

Screenshot of the Aspire dashboard showing the ginapp container resource built from a Dockerfile

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 /.

Pre-requisites

Running the app

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.