Docker
  • Introduction
    • What is Virtualization?
      • What is a Hypervisor?
      • Microsoft Hyper-V
    • What is Containerization?
      • What is docker?
      • What is a container image?
      • When to use containers?
      • When not to use Docker containers
  • Basics
    • ▶️Pull and run an image
      • Trivia
    • Basic docker commands
    • Container life cycle
  • Build an Image
    • ▶️Console app experiment
      • Hello-world image
    • What is a docker file?
      • Our docker file explained
    • ▶️Web app experiment
      • Create application
      • Create a docker file
      • Build an image
      • Run your image
      • Manipulating containers
  • Layers & Stages
    • Introduction
    • Image layers
    • Multistage images
Powered by GitBook
On this page
  • Create a simple application from a template using .NET.
  • Test the application
  1. Build an Image
  2. Web app experiment

Create application

PreviousWeb app experimentNextCreate a docker file

Last updated 1 year ago

Create a simple application from a template using .NET.

For our sample application, let’s create a simple application from a template using .NET. Create a directory in your local machine named dotnet-docker. Open a terminal and change to that directory. Run the following dotnet new command to create a C# app using the ASP.NET Core Web App template.

dotnet new webapp -n myWebApp -o src --no-https

Test the application

Let’s start our application and make sure it’s running properly. Open your terminal and navigate to the src directory and use the dotnet run command.

dotnet run --urls http://localhost:5000

Access the application:

The following page should appear.

image of app page

Press Ctrl+C in the terminal window to stop the application.

▶️
http://localhost:5000