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

  • Docker on Windows
  • Elton Stoneman
  • 272字
  • 2021-07-02 19:53:22

Summary

In this chapter, I took a closer look at Docker images and containers. Images are packaged applications, and containers are instances of an application, run from an image. You can use containers to do simple fire-and-forget tasks, you can 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 to build 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 tool to build an 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 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 that 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 place 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.

主站蜘蛛池模板: 泾川县| 溧阳市| 大姚县| 哈巴河县| 托克托县| 安图县| 新昌县| 霍城县| 垫江县| 四平市| 延边| 云龙县| 彭山县| 桦川县| 曲靖市| 五常市| 东平县| 雅安市| 嘉义市| 嫩江县| 东阳市| 宝应县| 万载县| 仪陇县| 宁德市| 三台县| 阿克陶县| 平顶山市| 佛冈县| 龙里县| 资兴市| 永福县| 易门县| 瑞昌市| 霍城县| 平和县| 苏尼特左旗| 栾川县| 黄山市| 隆尧县| 买车|