Este conteúdo não está disponível no idioma selecionado.

Chapter 5. Running .NET 10.0 applications in containers


You can use the ubi9/dotnet-100-aspnet image to run an ASP.NET Core application inside a Linux container.
For non-ASP.NET Core .NET applications, use the smaller ubi9/dotnet-100-runtime image.

Learn how to build a container image for an ASP.NET Core application directly from the .NET SDK and run it using Podman.

Prerequisites

  • The .NET 10.0 SDK is installed.
  • Podman is installed.
  • You have network access to the container registry specified in the ContainerBaseImage attribute (registry.access.redhat.com).

Procedure

  1. Create a new ASP.NET Core MVC project in a directory named mvc_runtime_example:

    $ dotnet new mvc --output mvc_runtime_example
    Copy to Clipboard Toggle word wrap
  2. Publish the project:

    $ dotnet publish mvc_runtime_example -f net10.0 /p:PublishProfile=DefaultContainer /p:ContainerBaseImage=registry.access.redhat.com/ubi9/dotnet-100-aspnet:latest
    Copy to Clipboard Toggle word wrap
  3. Run your image:

    $ podman run --rm -p 8080:8080 mvc_runtime_example
    Copy to Clipboard Toggle word wrap

Verification

  1. View the application running in the container:

    $ xdg-open http://127.0.0.1:8080
    Copy to Clipboard Toggle word wrap
Voltar ao topo
Red Hat logoGithubredditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar. Explore nossas atualizações recentes.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja o Blog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

Theme

© 2025 Red Hat