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
     
  • 相关阅读:
    网站实时信息采集和统计graphite
    内存检查工具Valgrind
    usr/bin/ld: cannot find 错误解决方法和 /etc/ld.so.conf
    通用makefile
    关于/proc/进程idpid/fd ,根据fd来查找连接
    boost enable_shared_from_this
    cdll和windll的差别
    一些项目——空白格式化
    Session笔记
    黑马程序猿_7K面试题之交通灯系统
  • 原文地址:https://www.cnblogs.com/wanghui-garcia/p/10169941.html
Copyright © 2011-2022 走看看