Commandes Linux : vagrant box add

VAGRANT BOX ADD

Commande : vagrant box add
Usage: vagrant box add [options] <name, url, or path>

Options:

    -c, --clean                      Clean any temporary download files
    -f, --force                      Overwrite an existing box if it exists
        --insecure                   Do not validate SSL certificates
        --cacert FILE                CA certificate for SSL download
        --capath DIR                 CA certificate directory for SSL download
        --cert FILE                  A client SSL cert, if needed
        --location-trusted           Trust 'Location' header from HTTP redirects and use the same credentials for subsequent urls as for the initial one
        --provider PROVIDER          Provider the box should satisfy
        --box-version VERSION        Constrain version of the added box

The box descriptor can be the name of a box on HashiCorp's Vagrant Cloud,
or a URL, or a local .box file, or a local .json file containing
the catalog metadata.

The options below only apply if you're adding a box file directly,
and not using a Vagrant server or a box structured like 'user/box':

        --checksum CHECKSUM          Checksum for the box
        --checksum-type TYPE         Checksum type (md5, sha1, sha256)
        --name BOX                   Name of the box
    -h, --help                       Print this help

 

Télécharger en local une box depuis le Vagrant Cloud

vagrant box add [options] <name>

ex :

$ vagrant box add debian/stretch64 --provider virtualbox
==> box: Loading metadata for box 'debian/stretch64'
    box: URL: https://vagrantcloud.com/debian/stretch64
==> box: Adding box 'debian/stretch64' (v9.5.0) for provider: virtualbox
    box: Downloading: https://vagrantcloud.com/debian/boxes/stretch64/versions/9.5.0/providers/virtualbox.box
    box:
==> box: Successfully added box 'debian/stretch64' (v9.5.0) for 'virtualbox'!

$ vagrant box list
debian/stretch64            (virtualbox, 9.5.0)
$ vagrant box add debian/stretch64 --box-version 9.1 --provider virtualbox
==> box: Loading metadata for box 'debian/stretch64'
    box: URL: https://vagrantcloud.com/debian/stretch64
==> box: Adding box 'debian/stretch64' (v9.1.0) for provider: virtualbox
    box: Downloading: https://vagrantcloud.com/debian/boxes/stretch64/versions/9.1.0/providers/virtualbox.box
    box:
==> box: Successfully added box 'debian/stretch64' (v9.1.0) for 'virtualbox'!

$ vagrant box list
debian/stretch64            (virtualbox, 9.1.0)

 

Télécharger en local une box depuis une url

vagrant box add [options] <url>

ex :

$ vagrant box add https://atlas.hashicorp.com/envimation/boxes/ubuntu-xenial-docker
==> box: Loading metadata for box 'https://atlas.hashicorp.com/envimation/boxes/ubuntu-xenial-docker'
==> box: Adding box 'envimation/ubuntu-xenial-docker' (v1.0.0-1516241473) for provider: virtualbox
    box: Downloading: https://vagrantcloud.com/envimation/boxes/ubuntu-xenial-docker/versions/1.0.0-1516241473/providers/virtualbox.box
    box:
==> box: Successfully added box 'envimation/ubuntu-xenial-docker' (v1.0.0-1516241473) for 'virtualbox'!

$ vagrant box list
envimation/ubuntu-xenial-docker (virtualbox, 1.0.0-1516241473)

 

Ajouter une box depuis un fichier .box local

vagrant box add [options] <path>

Le fichier .box utilisé pour la création de la box a été généré avec la commande vagrant package.
ex :

$ vagrant box add custom-lamp.box --name custom-lamp
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'custom-lamp' (v0) for provider:
    box: Unpacking necessary files from: file://D:/vagrant/projects/demo/custom-lamp.box
    box:
==> box: Successfully added box 'custom-lamp' (v0) for 'virtualbox'!
$ vagrant box list
custom-lamp                    (virtualbox, 0)

 

Fermer le menu
%d blogueurs aiment cette page :