In this article we will learn how to run an ASP.NET core web application in a docker container. The intend to write this article is to clear the hype around docker and make understandable to everyone by explaining in the simple and plain language.
What is Docker?
Docker is the platform for deploying and building the applications which delivers the application in the packages over the operating system level virtualization. Docker requires the following components to run the application
What is docker image?
What is Container?
Difference between Virtual Machine and Docker Container?
Step 1: Install Prerequisites
Step 2 : Create the ASP.NET Core Application
- Open Visual Studio (I am using 2019)
- Once Visual studio open then click on Continue Without Code(If you are using VS 2019)
- Then from Visual Studio Menu, click on File => New Project , as shown in the following image
Step 3: Add Docker Support
Step 4: Choose the Container (Docker File)
Step 5: Open the Docker File
- Final Image
Step 6: Run the image in Docker Container
- This tutorial is for the beginner, so there is no command line tool used to build, run the docker container images but internally after clicking on Visual Studio Run Option by choosing Docker option does the same thing
- The intend of this tutorial is to make familiar to beginners about docker.
- Next article we will learn how to build, run and create images using docker commands.