What are containers and how to containerizing an Asp.Net MVC application using Docker

Note: Setting up Docker engine in organisation's on-premise system is going to be a challenge due to permission and security issues so we will be going to use our Azure subscriptions to create VM if you don’t have already.
containers vs VMs
Note: This step is required for those who does not have a VM setup already.
Note: If DNS name is set up dynamic IP address will be no issues while login. Else you can set up static IP address.
Note: Turn on HyperV as prompted during the setup.Imp: After installing and starting Docker, right-click on the tray icon and select Switch to Windows containers. This is required to run Docker images based on Windows. This command takes a few seconds to execute.
# The `FROM` instruction specifies the base image. You are# extending the `microsoft/aspnet` image.FROM microsoft/aspnetWORKDIR /inetpub/wwwroot# The final instruction copies the site you published earlier into the container.COPY /bin/Release/PublishOutput/ /inetpub/wwwroot
Note: The path here is specific to the path where you have published the ASP.net application. Since I have used the default publish path I have kept the same in my dockerfile. This can be parameterized when using docker commands, but let’s keep that hardcoded for now.
Note: With the current Windows Container release, you can’t browse to http://localhost. This is a known behavior in WinNAT, and it will be resolved in the future. Until that is addressed, you need to use the IP address of the container.

--

--

--

Cloud architect | polyglot developer focusing on Azure, microservices, DevOps and Docker.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Static libraries in C Language

Python Libraries for Data Science

Unbosom Thoughts of DevComm

The Forestual II Ecosystem

Develop Docker Remotely from your Mac like a Pro

JavaFX, Build Mind-Blowing Desktop Application

Closer Scrutiny of Rust Collections [Part-3]

This image has an empty alt attribute; its file name is rust-2-wal.png

How to configure CircleCI and SonarQube for GoLang Application

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Somak Das

Somak Das

Cloud architect | polyglot developer focusing on Azure, microservices, DevOps and Docker.

More from Medium

Azure DevOps with Dockerized Jenkins, NGINX Proxy Manager and Cloudflare Part #1…

Docker and Docker Containers: An Overview

Docker and Docker Containers: An Overview

Implementing Dependency Injection In Azure Functions

Execute query to MS SQL database on Azure with Node.js