Welcome to this module of our Azure Kubernetes Service (AKS) course. In this lesson, you’ll learn how to:Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
- Scaffold and run a simple ASP.NET Core Razor Pages application
- Containerize the app using Docker Desktop
- Optionally pull a pre-built image from Docker Hub
Prerequisites
Make sure you have the following installed:| Prerequisite | Description |
|---|---|
| .NET 6 SDK | Download from Microsoft .NET |
| Docker Desktop | Install via Docker Desktop |
| Code Editor | Visual Studio Code, Visual Studio, or any editor of your choice |
Ensure Docker Desktop is running before you build or pull any images.
1. Creating the ASP.NET Core Application
We’ll scaffold a basic Razor Pages app and review theIndexModel class. Create a new project and replace the contents of Pages/Index.cshtml.cs with:
2. Containerizing with Docker
At the root of your ASP.NET project, add aDockerfile similar to:
| Dockerfile Stage | Purpose |
|---|---|
| build | Restores, builds, and publishes the app |
| runtime | Hosts the compiled app |
yourrepo/kodekloudapp:latest.
3. Using a Pre-built Image (Optional)
If you’d rather skip local builds, pull the image directly from Docker Hub:You can browse Docker Hub and search for
yourrepo/kodekloudapp to verify the image and get the exact pull command.