Allow for the image to be run with the root user if desired, however
change to requiring setting of a variable to allow it to continue as it
may change ownership of files unexpectedly.
Additionally ensure that the workdir passed to docker matches the target
mount path used, in case the realpath to ${PWD} resolves to be different
to it's value resulting in the starting workdir being somewhere
different to the current path on the host.
Fixes: #1442
Move the vagrant-libvirt plugin into being combined directly with
vagrant which both prevents the plugin from being reinstalled by any
subsequent call to `vagrant plugin install <plugin>` and avoids the need
to create and manage symlinks to a /vagrant.d directory for boxes.
When running the docker container, only output what is returned by
vagrant to stdout, and redirect everything else to stderr to facilitate
anything parsing stdout.
Fixes: #1463
In the entrypoint.sh script, the "$1" variable was used incorrectly
when determining default user based on the ownership of the vagrantfile
(or parents). The "$vagrantfile" variable should have been used
instead, as it was just set.
Signed-off-by: SG <13872653+mmguero@users.noreply.github.com>
To handle where the ~/.vagrant.d global state directory for a user
doesn't exist, and thus specifying it as part of the docker run command
will result in the docker daemon creating it with root ownership.
Switch to using the working directory for user/group resolution,
searching for the Vagrantfile in the starting path and then working
up the tree. If it's not found default to the original starting path.
Combined with checking if the mounted vdir is empty, use the resolved
user/group based on the Vagrantfile and working directory to modify the
newly created directory to belong to the running user. Subsequently
ensure that the directories referenced via symlinks are created if they
don't exist.
Fixes: #1191Closes: #1254
Switch to publishing the image containing all of the libraries and build
dependencies needed to support the plugin being reinstalled as that is
the default behaviour when vagrant installs a new plugin.
This should allow the default image to be extended with additional
plugins and if needed, the authors of the new image may follow and use
the slim version as a base to provide a reduced size docker image.
Fixes: #1198
Switch using "$@" to ensure that options provided on the command line to
be interpreted by vagrant are correctly passed on with appropriate
quoting. This fixes the issue where running the docker container with
`vagrant ssh -c 'ls -la'` would fail as the `-la` option was interpreted
by vagrant instead of being passed as part of the value for the `-c`
option.
Provide a docker image that supports execution of vagrant-libvirt
provided the host system has docker and libvirt installed. This can help
side step many of the library compatibility issues experienced by users
by providing an alternative way to run the latest code should their
distribution not have a natively packaged vagrant.