Questo contenuto non è disponibile nella lingua selezionata.

Chapter 5. Running .NET 10.0 applications in containers


To run .NET applications in an isolated environment, build container images directly from the .NET SDK and execute them using Podman.

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.

Prerequisites

  • You have installed .NET 10.0 SDK.
  • You have installed Podman.
  • 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
Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2026 Red Hat
Torna in cima