Step by step | .Net Core 3.1 Dockerfile example
ThinkofDockerfilesasbeingsimilartoarecipeforalayeredcake.YouinstructDockertobundleallthe“ingredients,”suchasyourcode,framework,server,settings,environmentvariablesandconfiguration.YouthenuseDockerto“bake”theingredients,andoutcomesanimage.Fromtheretheimagecanbepushedtodifferentlocations,suchasalocalmachine,on-premserver,orthecloud.Microsoftprovidesseveral ASP.NET[1] Coreimages(off-the-shelfcakerecipeswithalltheingredientsincluded)thatcanhelpgetyoustartedusingcontainersfordevelopmentorproducti...
Think of Dockerfiles as being similar to a recipe for a layered cake. You instruct Docker to bundle all the “ingredients,” such as your code, framework, server, settings, environment variables and configuration. You then use Docker to “bake” the ingredients, and out comes an image. From there the image can be pushed to different locations, such as a local machine, on-prem server, or the cloud.
Microsoft provides several ASP.NET[1] Core images (off-the-shelf cake recipes with all the ingredients included) that can help get you started using containers for development or production. With these as your base, you can take the image they provide and build on top of it to create a custom image. Lets examine this more by first taking a look at some of the ASP.NET Core images Microsoft provides.
References ASP.NET (asp.net)