In this article we will learn how to build and run ASP.NET core application in a docker container. The docker and containerization term is booming in the market and developer and IT professional curious to know and learn about the docker and containerization but due to lack of plain simple documentation people finds hard to understand about these terms and concepts, my intend to write this article is to clear the hype around these concepts and make understandable to everyone by explaining in the plain simple language.
Hype around the Docker Learning
Many documentation, articles and YouTube videos show lots of command line tools during building the docker application and often readers think that I need to learn these commands and due to this, they find it very difficult and complex to create the docker application but believe me you don't need all to remind and know the commands. Visual studio built in features for azure containers makes it very simple for you. You can first learn the docker concepts using the way which I am showing in this article, then once you are familiar with these terms and concepts, you can use advanced tools such as docker commands etc.
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?
What is 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.
- 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.