In this article we will see how to add docker support to ASP.NET core app directly from Visual Studio with just
3 Clicks without manually creating or writing any code to
- Navigate to the Solution Explorer of your project and
Right-click on the ASP.NET project -> Select
- Choose the Target OS where the docker image will run
Windows / Linux, and click
Visual Studio will create a
Dockerfilefor you, which specifies how to create the container image for your ASP.NET Core app project.
Click on the
Dockerbutton to build the image and run it inside a Docker container, rather than in IIS Express.
You could verify that your container is running using the Docker command-line tools; open a cmd or Terminal and type in
docker container lsto view the containers.
That's it, you have successfully added Docker support to your ASP.NET core app and your app is now running inside a Docker container.