用数字海洋图像设置一个无业游民 [英] Setting up a vagrant with a digitalocean image

查看:131
本文介绍了用数字海洋图像设置一个无业游民的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道是否应该在此处或在其他堆栈社区中发布此邮件,所以请让我知道它是否在此处错误发布。

I dont know if this should be posted here or on another stack community so please let me know if its wrong posting it here.

如何获取本地邮件(即在我的笔记本电脑上)与我运行的DO液滴(Ubuntu 14.04-LAMP等)相同的VM?

How do I get a local (i.e. on my laptop) VM that is identical to my DO droplet (Ubuntu 14.04 - LAMP etc) running?

DO是否为Vagrant提供了可复制DO液滴设置的预配器?

Does DO provide a provisioner for Vagrant that can replicate the setup of a DO droplet?

能够在我的机器上而不是在云中的Droplet上进行开发很方便。

It's handy being able to develop on my machine, instead of on a Droplet in the cloud.

推荐答案

我最近在研究基于不变的服务器设计

我打算使用 Packer 为我的每台服务器构建正确配置的映像。然后,我将使用 Vagrant VirtualBox 之前,先将该图片祝福用于集成,舞台和生产环境中。

I am planning on using Packer to build properly provisioned images for each of my servers. I would then utilize Vagrant to test my environment locally in VirtualBox prior to blessing the image for use in integration, stage, and production environments.

在阅读包装器-流浪者盒子入门教程,我注意到这一行:

While reading the Packer - Getting Started for Vagrant Boxes tutorial I noticed this line:


如果您按照上一页中的步骤进行操作并设置DigitalOcean,
Packer目前无法为DigitalOcean制造Vagrant盒子,但是
很快就能。

If you followed along in the previous page and setup DigitalOcean, Packer can't currently make Vagrant boxes for DigitalOcean, but will be able to soon.

这似乎已经存在于文档中一段时间​​了,以便谁知道何时很快出现。会,但是我还没有找到任何官方信息。

This appears to have been on the documentation for some time now so who knows when "soon" will be, but I haven't found any official information on this yet.

我后来遇到了此博客文章讨论了解决此限制的两种可能方法。

I later came across this blog post that discusses two possible ways to work around this limitation.


  1. 手动将Digital Ocean Droplet转换为VMware VM

  2. 只需简单地模拟数字海洋环境并从类似的基础映像中进行工作即可解决

I仔细阅读(1)的说明,尽管听起来很耗时且容易出错,但听起来确实合法。听起来,模拟设置是目前最好的选择。

I read through the instructions for (1) and it does sound legitimate although it is a rather time consuming and error prone endeavor. It sounds like emulating the setup is the best bet for now.

如果有人知道此处的最新动态,请在下方评论。

我还没有测试它,最后一次更新是几年前的,但这听起来像此博客文章和引用 git repo 可能是一个好的开始。它似乎仍然不是从DO图像实际构建图像,但是通过仔细模拟,它是上面(2)的一个很好的例子。

I haven't tested it yet and the last update was from several years ago, but it sounds like this blog post and referenced git repo may be a good start. It still doesn't seem to be actually building the image from the DO image, but it is a pretty good example of (2) above by closely emulating.

<一个href = https://www.packer.io/docs/post-processors/vagrant.html rel = nofollow noreferrer>包装商的无所事事的后处理程序似乎表明它 CAN 从DigitalOcean图像创建一个无聊的盒子。如果这是真的,那么一个完美的理智的流程就是使用 Packer 来构建一个从DO到测试的预配置的无用信息框同时在验证后构建DO映像以在集成/阶段上旋转(在集成/阶段),使其按本地VM中的通告运行。然后,您可以在其余的生活环境中推广DO图像。

Oddly enough the documentation for Packer's Vagrant post-processor seems to indicate that it CAN create a vagrant box from a DigitalOcean image. If this is true then a perfectly sane flow would be to use Packer to build a provisioned vagrant box from DO to test at the same time building a DO image to spin up (on integration/stage) after verification it works as advertised in VM locally. Then you can promote the DO image through the rest of your live environments.

这篇关于用数字海洋图像设置一个无业游民的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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