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

  • Docker for Developers
  • Richard Bullington McGuire Andrew K. Dennis Michael Schwartz
  • 355字
  • 2021-06-11 18:15:21

Chapter 2: Using VirtualBox and Docker Containers for Development

In the previous chapter, we introduced virtualization and containerization. In this chapter, we'll demonstrate how you can use software such as VirtualBox to create virtual machines and we'll use Docker to create containers. The focus of this chapter will be on using these technologies for development on your workstation.

A common problem among developers who work on multiple projects is that, over time, they end up with a lot of software installed on their workstations that they don't currently use. This can be so problematic that the developer might reformat their workstation's hard drive and reinstall the operating system.

Both VirtualBox and Docker containers can be used to resolve this problem. The software you install stays within either the virtual machine's or the container's filesystem and is separate from the workstation's native filesystem. If you delete a virtual machine or container, all the files installed therein are removed – including any applications or development software that was installed.

Another problem that arises for developers is the version of software required to work on a specific project. If the developer is working on one project that uses Node.js v12 and another that uses Node.js v10, they can't really run both projects on the workstation at the same time and switching between versions of Node.js is doable, but ugly. This is a non-issue with virtual machines or containers – you can have one virtual machine with Node.js v12 and another with Node.js v10 and run both virtual machines at the same time. It is similar with two containers, one for each version of Node.js.

Virtualization is very useful when you need to model an entire machine. If your production systems are virtual machines or physical machines, a virtual machine is a good way to emulate that environment. Virtualization is terrific for running a complete alternate operating system on the workstation; that is, you can run Windows 10 in a virtual machine on a macOS or Linux workstation.

In this chapter, we will cover the following topics:

  • Host filesystem pollution problem
  • Using VirtualBox for virtual machines
  • Using Docker containers
主站蜘蛛池模板: 鲜城| 山东| 惠州市| 延长县| 安仁县| 富平县| 鄂伦春自治旗| 山阴县| 西乌珠穆沁旗| 蒲城县| 讷河市| 盐津县| 武安市| 余干县| 伊通| 桃园市| 阳城县| 镇赉县| 嵊州市| 开封县| 栖霞市| 东安县| 招远市| 合江县| 株洲县| 长葛市| 靖江市| 枣强县| 邻水| 陆川县| 同江市| 双柏县| 连平县| 靖江市| 屏山县| 故城县| 枣庄市| 宁河县| 寻甸| 蒙山县| 平山县|