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

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
主站蜘蛛池模板: 汽车| 游戏| 论坛| 宁远县| 万山特区| 广河县| 中山市| 正阳县| 辽宁省| 龙陵县| 华容县| 珲春市| 道真| 克什克腾旗| 大同县| 子长县| 洮南市| 揭东县| 彰化市| 长岛县| 鲜城| 晋江市| 文昌市| 辽中县| 宜黄县| 临沧市| 新绛县| 潜山县| 绥滨县| 焦作市| 阿坝县| 德昌县| 乌鲁木齐县| 常德市| 黄梅县| 盐边县| 青海省| 新疆| 阿鲁科尔沁旗| 郓城县| 黑龙江省|