이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 5. Running .NET 9.0 applications in containers
Use the ubi8/dotnet-90-runtime
image to run a .NET application inside a Linux container.
The following example uses Podman.
Procedure
Create a new MVC project in a directory called
mvc_runtime_example
:dotnet new mvc --output mvc_runtime_example
$ dotnet new mvc --output mvc_runtime_example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Publish the project:
dotnet publish mvc_runtime_example -f net9.0 /p:PublishProfile=DefaultContainer /p:ContainerBaseImage=registry.access.redhat.com/ubi8/dotnet-90-runtime:latest
$ dotnet publish mvc_runtime_example -f net9.0 /p:PublishProfile=DefaultContainer /p:ContainerBaseImage=registry.access.redhat.com/ubi8/dotnet-90-runtime:latest
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Run your image:
podman run -rm -p8080:8080 mvc_runtime_example
$ podman run -rm -p8080:8080 mvc_runtime_example
Copy to Clipboard Copied! Toggle word wrap Toggle overflow View the application running in the container:
xdg-open http://127.0.0.1:8080
$ xdg-open http://127.0.0.1:8080
Copy to Clipboard Copied! Toggle word wrap Toggle overflow