第5章 コンテナーでの .NET 8.0 アプリケーションの実行
ubi8/dotnet-80-runtime イメージを使用して、.NET コンテナーで事前コンパイルされたアプリケーションを実行します。
以下の例では Podman を使用しています。
手順
mvc_runtime_exampleという名前のディレクトリーに新しい MVC プロジェクトを作成します。$ dotnet new mvc --output mvc_runtime_exampleプロジェクトを公開します。
$ dotnet publish mvc_runtime_example -f net8.0 /p:PublishProfile=DefaultContainer /p:ContainerBaseImage=registry.access.redhat.com/ubi8/dotnet-80-runtime:latestイメージを実行します。
$ podman run -rm -p8080:8080 mvc_runtime_exampleコンテナーで実行されているアプリケーションを表示します。
$ xdg-open http://127.0.0.1:8080