为什么要在Vagrant下运行Docker? [英] Why run Docker under Vagrant?

查看:105
本文介绍了为什么要在Vagrant下运行Docker?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了多篇有关如何执行此操作的文章,但是我无法弄清楚macOS带来的好处.

I've read multiple articles how to do this, but I can't figure out what the benefits are under macOS.

从我的角度来看,您可以使用Docker Community Edition(boot2docker + Kitematic)在macOS上本地运行Docker.从无业游民,机动性,这对我有什么帮助?

From my point of view, you can run Docker natively on macOS using Docker Community Edition (boot2docker+Kitematic). What does it's give me for running from Vagrant, mobility?

推荐答案

我的标准日常开发工作是在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.

这篇关于为什么要在Vagrant下运行Docker?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆