Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why use Docker for .NET web apps when we have WebDeploy?

In the Microsoft ecosystem, people were happily deploying web apps using WebDeploy Packages until Docker came along. Suddenly everyone started preferring to use Docker instead, with articles being written telling how to WebDeploy into a Docker image.

I've searched this article (and others) for the word "why" and haven't found an explanation, leaving me to infer that the answer is just "because Docker."

I'm probably oversimplifying, but it seems that WebDeploy Packages and Docker images serve similar purposes for deployment, and it's unclear to me why I would want to take a perfectly good WebDeploy Package and put it in a Docker image. What am I missing? What additional benefits does Docker bring above and beyond what we have with WebDeploy? When should I choose one over the other, or use both together?

like image 583
Oran Dennison Avatar asked Jun 08 '18 23:06

Oran Dennison


People also ask

Can we deploy .NET application on Docker?

To use Docker to deploy your ASP.NET application, you must first build a Dockerfile. This file specifies how your application will be developed and packaged for use in a Docker container. Using the 'docker build' command, you can generate a container image after you have built your Dockerfile.

Can you use Docker with .NET framework?

NET 6; you can use Docker containers that include the traditional . NET Framework. However, a recommended approach is to use . NET 6 as you extend an existing application, such as writing a new service in ASP.NET Core.

Can you Containerize .NET application?

Containerizing a . NET application is easy. You can do this by copying source code files and building a Docker image. We'll also cover common concerns like image bloat, missing image tags, and poor build performance with these nine tips for containerizing your .

Can we Containerize .NET framework?

NET Framework application must run on Windows, period. If you want to containerize existing . NET Framework applications and you can't or don't want to invest in a migration to . NET Core or later("If it works properly, don't migrate it"), the only choice you have for containers is to use Windows Containers.


1 Answers

One of docker feature is to record an execution environment in an archive called an image.

That way, you don't have to setup the exact same configuration on a new machine, you can simply run said image on any machine supporting docker, and presumably get the exact same environment execution (same Windows, same Webdeploy version, same IIS, ...)

A WebDeploy Packages is a deployment artifact (like a jar, war, or any other artifacts), which does not include what is needed to run said artifact.

A docker image includes everything already installed, ready to be executed.
You can have the same image used at runtime (docker run) with:

  • different configuration files (through bind mounts or volumes)
  • different environment variable (docker run -e var=value)
like image 162
VonC Avatar answered Oct 10 '22 05:10

VonC