且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么要在Vagrant下运行Docker?

更新时间:2023-11-01 10:23:58

我的标准日常开发工作是在Docker For Mac/Windows上进行的,因为它们涵盖了我需要使用Docker进行的约95%的工作.自从他们取代Docker Toolbox/boot2docker并无缝集成到操作系统以来,我发现很少有理由转移到另一个虚拟机.我现在看到使用使用Vagrant 或独立VM的两个主要原因是用于VM定制和群集.

My standard day to day development work is carried out in Docker For Mac/Windows as they cover about 95% of what I need to do with Docker. Since they replaced Docker Toolbox/boot2docker and made the integration to the OS pretty seamless I have found very few reasons to move over to another virtual machine. The two main reasons I see for using Vagrant or standalone VM's now are for VM customisation and clustering.

由Docker工具箱(适用于Mac/Windows的Docker)提供的虚拟机已预先打包,用于缩减Linux发行版( TinyCore Alpine )都是短暂的,除了Docker配置外,所以您不会说太多他们如何工作.

The virtual machines supplied by Docker Toolbox, Docker for Mac/Windows are pre packaged cut down Linux distros (TinyCore and Alpine) that are largely ephemeral, except for the Docker configuration so you don't get much say in how they work.

我处理了许多预打包的VM中无法实现的自定义网络配置,主要是将容器连接到可路由网络而不是使用映射端口.

I deal with a number of custom network configurations that just aren't possible in the pre packaged VM's, largely around having containers connected to routable networks rather than using mapped ports.

有时,您需要使用devicemapper复制运行旧版本Docker守护程序的服务器环境或RHEL服务器. VM让您选择要安装的软件包.

Occasionally you need to replicate server environments that run old versions of the Docker daemon, or RHEL servers using devicemapper. A VM let's you choose the packages to install.

建立一个群体,或扩展到中球体/

Building a swarm, or branching out into Mesosphere/Kubernetes will require multiple VM's. I tend to find these easier to manage and build with Vagrant rather than Docker Machine, and again they require custom config inside the VM.