This app demonstrates publishing an app as native AOT in containers.
Note
The base images used by this sample are in preview.
A similar console app sample supports single file deployment (non-AOT scenario). This app could also be deployed that way.
You can build and run the sample:
docker build --pull -t app .
docker run --rm -it -p 8000:8080 -e ASPNETCORE_HTTP_PORTS=8080 app
It exposes two endpoints:
http://localhost:8000/releases
http://localhost:8000/healthz
The app is intended as a sort of compliance report for .NET. The report includes supported major releases and those recently out of support. It includes the latest and latest security patch versions for each of those major releases.
This same information is available from the release JSON files that the team maintains, but that requires a bit of code to provide the same report.
The sample includes several Dockerfiles with varying functionality. The base images they use are currently experimental (not supported).
These Dockerfiles work on AMD64 and Arm64, targeting the matching architecture.
The following samples support cross-compile, which means you can use --platform linux/amd64
on Arm64 and vice-versa.
The Debian Dockerfiles need to be built on the specified architecture and can be used to build for both the host or target architecture. When building for the target architecture, the --platform
switch must be used.
Additional cross-compilation options are described in the dotnet/runtime repo.