What I want and achieved so far: I want to create a custom vagrant box including a configuration and an application to reuse it in different client or serve environments.
Specifically I managed to create vagrant box, based on Ubuntu (precise/64), that has node.js installed, and package it on my dev machine with
vagrant package my-box --output filename.box
I am able to copy the filename.box to a remote server and vagrant up
the box there. Node.js is installed within the vagrant box as expected.
The problem is, that I am not able to package the files in the synced folder vagrant
. After starting the box on the remote server, the synced folder is empty
Therefore the application I developed on the local machine is not included in the box.
I tried to find a solution or any information about this behavior, but apart from this unanswered Post i couldn't find anything on the net.
My questions:
- How can i preserve the files in the synced folder and package them in the filename.box for reuse in the server environment.
- Is this even possible? Is the behavior I see a bug or is Vagrant not meant to package the files also?
- I didn't do any configuration for the synced folders so far. Is it possible to package files from a different synced folder than the regular
/vagrant
? - If this is not possible at all, what are best practices for deployment or reusage of vagrant environments including applications?