zoukankan      html  css  js  c++  java
  • virtualbox+vagrant学习-2(command cli)-6-vagrant init命令

    Init——创建Vagrantfile文件

    格式:

    vagrant init [options] [name [url]]

    通过创建初始的Vagrantfile文件(如果不存在的话),将当前目录初始化为vagrant环境。

    userdeMacBook-Pro:~ user$ vagrant init -h
    Usage: vagrant init [options] [name [url]]
    
    Options:
    
            --box-version VERSION        Version of the box to add 添加的box的版本
        -f, --force                      Overwrite existing Vagrantfile 复写已经存在的Vagrantfile文件
        -m, --minimal                    Use minimal Vagrantfile template (no help comments). Ignored with --template
                                         使用最小化的Vagrantfile模版(这种模版是没有帮助注释的),使用它将会忽视--template标签的使用
            --output FILE                Output path for the box. '-' for stdout  box的输出路径,如果FILE为'-',意味输出的Vagrantfile将送到stdout
            --template FILE              Path to custom Vagrantfile template 定制Vagrantfile模版的路径
        -h, --help                       Print this help 打印帮助信息

    如果给出第一个参数,它将在创建的流浪者文件中预填充config.vm.box
    如果给出第二个参数,它将在创建的Vagrantfile中预填充config.vm.box_url

    例子:

    创建基本的Vagrantfile:

    $ vagrant init hashicorp/precise64

    创建最小化的Vagrantfile文件 (无注释):

    $ vagrant init -m hashicorp/precise64

    创建新的Vagrantfile文件, 将当前路径下的覆盖:

    $ vagrant init -f hashicorp/precise64

    为来自指定box URL的执行box创建Vagrantfile文件:

    $ vagrant init my-company-box https://boxes.company.com/my-company.box

    创建一个Vagrantfile文件,对box进行版本限制:

    $ vagrant init --box-version '> 0.1.5' hashicorp/precise64
     
  • 相关阅读:
    铁大电梯调度需求分析
    结对开发2
    四则运算3
    团队开发——冲刺2.d
    团队开发——冲刺2.c
    团队开发——冲刺2.b
    团队开发——冲刺2.a
    团队开发——冲刺1.g
    团队开发——冲刺1.f
    团队开发——冲刺1.e
  • 原文地址:https://www.cnblogs.com/wanghui-garcia/p/10169941.html
Copyright © 2011-2022 走看看