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

1

11

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?

Homogenous answered 8/6, 2018 at 23:56 Comment(3)
WebDeploy does not solve the "works on my machine" problem.Cryptozoite
Good point, WebDeploy doesn't directly solve that problem. But if your dev and test environments are on Azure, and your production environment is also Azure, then WebDeploy alone may be good enough to address that concern.Homogenous
Some recommend using different Docker images for dev, build, and production. It seems this could cause "works on my image" problems. learn.microsoft.com/en-us/dotnet/core/docker/…Homogenous
T
10

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:

Tammitammie answered 14/6, 2018 at 18:10 Comment(1)
This is exactly the point of docker. It provides environment portability through the container. Something which is usually difficult to achieve without a full-blown virtual machine image.Demp

© 2022 - 2024 — McMap. All rights reserved.