Vagrant 的更好替代方案
我们使用 Vagrant 进行开发环境自动化和配置。它工作顺利。但有时,如果 vagrant 遇到一些问题(从 SSH 到网络配置,我们遇到了很多问题),加入我们的新开发人员应该启动盒子并开始工作,但他们真的很难应对这个问题。所以我只是想知道,是不是有一些更简单的方法(比如使用像 VirtualBox 这样的 GUI 来启动和结束环境)来管理这些虚拟环境?
也许我的问题应该是,除了 Vagrant 之外,这个领域的最佳实践是什么?
We use Vagrant for dev environment automation and provisioning. It works smoothly. But sometimes, if vagrant has some problem(we faced LOT of them starting from SSH to networking config), the new developers who join us and are supposed to just boot up the box and start working, have a really hard time coping up with that. So I was just wondering, ain't there some easier way(like having a GUI like VirtualBox to start and end an env) of managing these virtual environments?
maybe my question should be, What are the best practices on this area, other than Vagrant?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
Vagrant 使用 virtualbox 作为虚拟化层,因此您可以使用 gui 启动 vagrant vm。将以下内容添加到您的 VagrantFile 中。
另请查看 sahara,因为它可以让您将其视为具有快速回滚等功能的沙箱。
Vagrant uses virtualbox as the virtualization layer, so you can start a vagrant vm using the gui. Add the following to your VagrantFile.
Also take a look at sahara as it lets you treat it more like a sandbox with quick rollbacks, etc.
我将在这里回应其他评论。如果您已经有了可以顺利运行的设置,请确保每个人都使用相同版本的 VirtualBox、Vagrant 和 Basebox。
至于 UI 和更多分发选项,您可能会对 Wanton 感兴趣:https://github.com/maestrodev/wanton
I'll echo the other comment here. If you already have a setup that works smoothly make sure you have everyone using the same versions of VirtualBox, Vagrant and the basebox.
As for a UI and more distribution options you might find Wanton of interest: https://github.com/maestrodev/wanton
nix
包管理器确实值得一试:http://nixos.org/nix它提供命令
nix-shell
,它根据该文件启动一个 shellshell.nix
,对应nix世界中的Vagrantfile
。然而,与 Vagrant 相比,不涉及昂贵的虚拟化。神奇的事情发生的是使用构建输入的加密哈希进行包管理的功能方法。
The
nix
package manager is really worth checking out: http://nixos.org/nixIt provides the command
nix-shell
, which starts a shell based on the fileshell.nix
, which corresponds to theVagrantfile
in the nix-world.In contrast to Vagrant however there is no costly virtualization involved. What makes the magic happen is the functional approach to package management using cryptographic hashes of the build inputs.
GUI 模式的配置已在 v1.1 中更新:
来自:http://docs.vagrantup .com/v2/virtualbox/configuration.html
除此之外,我对新版本非常满意,我会尝试一下
The configuration was updated in v1.1 for GUI mode:
From: http://docs.vagrantup.com/v2/virtualbox/configuration.html
Besides that, I am very happy with the new version, I would give it a try
我不确定是否有其他选择。 Vagrant 是一个相对较新的软件。当虚拟机上的 virtualbox 插件版本与主机上的 Virtualbox 版本不同时,Vagrant 上的 ssh 似乎会出现问题,并且我不确定除了重新安装正确的版本之外还有其他解决方案。
编辑 virtualbox 插件被命名为 VirtualBox Guest Additions
I'm not sure there is an alternative. Vagrant is a relatively new software. Problems with ssh on Vagrant seems to appear when virtualbox addons version on the VM is different from the Virtualbox version on the host machine, and I'm not sure there is a solution apart from reinstalling correct versions.
edit virtualbox addons are named VirtualBox Guest Additions
将“config.ssh.forward_x11 = true”添加到您的 Vagrantfile 中,然后您就可以轻松使用 X-Windows。
Add "config.ssh.forward_x11 = true" to your Vagrantfile then you can easily use X-Windows.
我过去使用过 vagrant,并且还切换到了纯 docker 解决方案,因为它太重/难以设置/启动速度慢(这是我个人的观点)。我通常使用 docker compose 构建文件,当我不想手动执行此操作时,我使用 stakkr (用 python 制作的轻量级包装器: https://github.com/edyan/stakkr)。
干杯
I used vagrant in the past and I also switched to a pure docker solution because it was too heavy / difficult to setup / slow to star (that is my personal point of view). I usually build my files with docker compose and when I don't want to do it manually I use stakkr (a lightweight wrapper made in python : https://github.com/edyan/stakkr).
Cheers
如果您不介意配置开销,您可以使用 Docker https://www.docker.com/
You could use Docker if you don't mind the configuration overhead https://www.docker.com/
我建议使用 devilbox
使用 docker 作为后端
I suggest to use devilbox
that using docker as backend