Vagrant Boxes for XWiki

Hi everyone,

I recently started testing Vagrant for my personal projects around XWiki. Vagrant is a tool that allows to quickly spin up a development environment inside a virtual machine, which you can use for one of your projects :

HashiCorp Vagrant provides the same, easy workflow regardless of your role as a developer, operator, or designer. It leverages a declarative configuration file which describes all your software requirements, packages, operating system configuration, users, and more.

I find this approach interesting when XWiki needs to be integrated along with other infrastructure components : an Apache2 server, an external Solr index, …

In Vagrant, it is possible to “kickstart” a development environment from a base “box” (which is essentially the image of the virtual machine, plus some metadata). Vagrant provides a catalog of boxes from which a project can be kickstarted. You can find “simple” boxes, such as a base Debian box, or boxes with pre-installed software, which is the case of this one, with Elastic pre-installed.

I’d like to propose to publish Vagrant boxes with a default XWiki installation. The idea would be to provide these boxes as a “contrib” installation method : where the project does not commit to update the boxes at each release, and then see how it goes. In the team I work in at XWiki SAS, we may have some needs for such development environment, and may push some improvements to the boxes over time.

WDYT of the idea ?

In the meantime, I’ll create a contrib repository for now in xwiki-contrib/vagrant ; as well as the JIRA project VAGRANT to put the code that I have so far for building the boxes.

Hi @caubin

Thanks for proposing this. I have used vagrant in the past (pre-docker era). I’ve always thought that it got replaced by Docker. Since I’m no longer familiar with Vagrant these days, could you list some pros and cons of Vagrant vs Docker nowaday and why (or when) you think it’s better to use a vagrant box than a docker image/docker compose for example?

Thanks

Hi Vincent,

The two technologies seem quite similar in term of functionalities offered from my perspective, with the difference of :

  • Docker having a more lightweight approach (containers are faster to run compared to VMs)
  • Vagrant ensuring a more strong isolation of resources

I see Vagrant more as a tool for the developers rather than a mean to deploy an application in production : in that case, having a virtualized environement gives a bit more flexibility to set-up tools and workflows to work on a project. However, I have to say that I did not worked that much with containers as a way to create development environments. In that matter, I would tend to use tools that are different than Docker, such as systemd-nspawn for ex. as Docker is more oriented towards disposable containers, rather than creating persistent machines.

If you wish to go in the details, here are some articles that provide some insights about the difference between Vagrant and Docker :

Thanks Clement for the infos. Personally I much prefer Docker for developers for 2 reasons:

  • it’s way faster to start/stop containers and on dev machines you need to do that often
  • it’s a lot less resource hungry. I’ve tried in the past to use VMs and it just uses too much resources/memory on dev machines and it slows down everything.

YMMV.

My current thinking is:

Thanks!