官术网_书友最值得收藏!

  • Docker on Windows
  • Elton Stoneman
  • 273字
  • 2021-07-02 12:47:58

Summary

In this chapter I took a closer look at Docker images and containers. Images are packaged versions of applications, and containers are instances of an application, run from an image. You can use containers to do simple fire-and-forget tasks, work with them interactively, or have them running in the background. As you start to use Docker more, you'll find yourself doing all three.

The Dockerfile is the source script for building an image. It's a simple text file with a small number of instructions to specify a base image, copy files, and run commands. You use the Docker command-line to build the image, which is very easy to add as a step to your CI build. When a developer pushes code that passes all the tests, the output of the build will be a versioned Docker image, which you can deploy to any host knowing that it will always run in the same way.

I looked at a few simple Dockerfiles in this chapter, and finished with a real-world application. NerdDinner is a legacy ASP.NET MVC app that was built to run on Windows Server and IIS. Using multi-stage builds, I packaged that legacy app into a Docker image and ran it in a container. This shows that the new model of compute which Docker offers isn't just for greenfield projects using .NET Core and Nano Server - you can migrate existing apps to Docker and put yourself in a good position to start modernizing them.

In the next chapter I'll use Docker to modernize the architecture of NerdDinner, breaking features out into separate components, and using Docker to plug them all together.

主站蜘蛛池模板: 莆田市| 东乌珠穆沁旗| 安庆市| 虹口区| 蓝山县| 独山县| 巴青县| 农安县| 江都市| 晋中市| 德格县| 白银市| 合水县| 陇川县| 靖远县| 谷城县| 莱州市| 南昌市| 克什克腾旗| 汉阴县| 荥经县| 六盘水市| 城口县| 上饶市| 古交市| 宁夏| 滦平县| 西和县| 慈利县| 舒兰市| 南充市| 庆元县| 泰顺县| 济阳县| 平湖市| 奎屯市| 余姚市| 平顶山市| 东至县| 白城市| 布拖县|