vgrepo
is a tool for managing Vagrant repositories written in Python.
pip install vgrepo
git clone [email protected]:gongled/vgrepo
python vgrepo/setup.py install
Specify storage settings in the /etc/vgrepo.conf
configuration file:
storage:
path: "/srv/vagrant"
url: "http://localhost:8080"
Run a NGINX with the following configuration of virtual host:
server {
listen 8080;
server_name localhost;
root /srv/vagrant;
location ~ ^/([^\/]+)/$ {
index /metadata/$1.json;
try_files /$1/metadata/$1.json =404;
}
location ~ \.json$ {
add_header Content-Type application/json;
}
location ~ \.box$ {
add_header Content-Type application/octet-stream;
}
location / {
autoindex off;
expires -1;
}
}
Well done. Now you can use http://localhost:8080/boxname
in the config.vm.box_url
parameter.
Usage: vgrepo [command] [options]
Commands
add or a Add image into the Vagrant's repository
list or l Show list of available images
remove or r Remove image from the repository
help or h Display current help message
Options
-v, --version Value of version of the box
-n, --name Name of box in the repository
-d, --desc Description of the box in the repository
-p, --provider Name of provider (e.g. virtualbox)
Examples
vgrepo add image.box --name box --version 1.0.1
vgrepo remove powerbox --version 1.1.0
vgrepo list