This is a proof of concept of a .NET 6 Web API created with the dotnet new webapi
command running in a podman container.
- Start the Podman managed VM (Fedora CoreOS) with the following commands:
podman machine init
podman machine start
- Run the following command to build an image of this app:
podman build -t podman-dotnet-poc .
Verify it was created successfully with the following command:
podman images
- Run the following command to create, but not start, a container with the image from the previous step:
podman create -p 8080:80 localhost/podman-dotnet-poc:latest
Verify it was created successfully with the following command:
podman ps --all
- Start the container with the following command:
podman start [container ID from previous command]
Verify the container is running with the following command:
podman ps
Note: You can combine steps 3 and 4 into one command:
podman run -d -p 8080:80 localhost/podman-dotnet-poc:latest
- Run
dotnet run
in this folder - Make an HTTP Get request to
https://localhost:[port in output]/time