-
Generate appropriate Git tags, Git tag documentation for more information.
-
Create appropriate published app. Either self-contained or framework-dependent, using either Visual Studio or terminal. Self-Contained Publishing & dotnet publish documentation.
Basically rundotnet publish --self-contained -r <RID> -c Release
where<RID>
is the runtime identifier for the target platform. For example,win-x64
for Windows 64-bit. The resulting output is a folder with the app and all its dependencies. The app can be run by executing the app's executable file. -
Create a Docker image.
How to make image with .NET SDK -
Create a Container.
-
Make appropriate preparations for online services if needed. For this app, I will use Azure Container Apps, which requires Azure CLI.
How to publish to Azure Container Apps
- Self-contained publishing does not need users to have .NET runtimes. Framework-dependent publishing does. Both are platform dependent so important to specify the runtime identifier, otherwise it defaults to the currently used platform.
- Docker images/containers can either be created in Docker or at the same time when publishing .NET apps. Both ways require Docker to run.
- Docker containers can be created an ran in 2 ways. One with
docker create
and withdocker run
. The former creates a container and the latter creates and runs a container. The former is more handy when it isn't necessary to run the container upon it's creation. - Git tags default to lightweight tags. Consider using an alias for annotated tags as they are generally more useful.