In lesson 2.9.1, you started finished images. Now you build one: the Kladde itself. For that you don't need a Dockerfile. The .NET SDK can publish a project directly as a container image, with sensible defaults for base image, port and user. At the end of the lesson, Kladde.Web runs as a container next to your SQL Server container, as the user app, and reports at /health whether it is well.

Without a Dockerfile

The classic way to an image is a Dockerfile: a text file with instructions like "take this base image, copy these files into it, start this program". Docker builds the image from it. That works, but it requires you to get everything right yourself, from the base image through the user to the order of the layers.

Since .NET 8, dotnet publish can do that itself. It compiles the app, picks the matching base image, puts the published files on top as a layer of their own and writes the details about port, user and start command into the image. It doesn't need Docker for that; you need Docker or Podman only to start the image locally afterward.

A Dockerfile remains necessary when an image has to run commands while it is built, such as installing an operating system package. For the Kladde, that's not the case. How it would work with a Dockerfile is shown by Microsoft's tutorial under "Further reading".