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?
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.
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.
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 .
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.
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:
docker run -e var=value
)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With