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
 

virtualbox+vagrant学习-2(command cli)-6-vagrant init命令的更多相关文章

  1. virtualbox+vagrant学习-2(command cli)-17-vagrant ssh命令

    SSH 格式: vagrant ssh [options] [name|id] [-- extra ssh args] 这将SSH导入正在运行的vagrant机器,并允许你访问机器的shell. us ...

  2. virtualbox+vagrant学习-2(command cli)-26-vagrant share命令

    Share share命令初始化了一个vagrant share会话,允许你与世界上任何一个人共享vagrant环境,允许在几乎任何网络环境中直接在vagrant环境中进行协作. 你可以在本博客的vi ...

  3. virtualbox+vagrant学习-2(command cli)-1-vagrant box命令

    vagrant box 这是用于管理(添加.删除等)boxes的命令. box 是一个打包好的操作系统,是一个后缀名为 .box 的文件,其实是一个压缩包,里面包含了 Vagrant 的配置信息和 V ...

  4. virtualbox+vagrant学习-2(command cli)-2-vagrant cloud命令--有问题

    Cloud https://www.vagrantup.com/docs/cli/cloud.html 命令: vagrant cloud 这是用来管理与vagrant相关的任何东西的命令. 该命令的 ...

  5. virtualbox+vagrant学习-2(command cli)-7-vagrant login命令

    Login ⚠️该命令已经弃用了,别名为vagrant cloud auth login.看本博客的 格式: vagrant cloud auth login [options] 登录命令用于使用Ha ...

  6. virtualbox+vagrant学习-2(command cli)-11-vagrant PowerShell命令

    PowerShell 格式: vagrant powershell [-- extra powershell args] 这将在主机上打开PowerShell提示符,进入正在运行的vagrant机器. ...

  7. virtualbox+vagrant学习-2(command cli)-4-vagrant global-status命令

    Global Status 格式: vagrant global-status 这个命令将告诉你当前登录的用户系统上所有活跃的vagrant环境的状态. userdeMacBook-Pro:~ use ...

  8. virtualbox+vagrant学习-2(command cli)-21-vagrant up命令

    Up 格式: vagrant up [options] [name|id] 这个命令根据你的Vagrantfile文件创建和配置客户机. 这是“vagrant”中最重要的一个命令,因为它是创建任何va ...

  9. virtualbox+vagrant学习-2(command cli)-23-vagrant version命令

    Version 格式: vagrant version options只有 -h, --help 该命令将告诉你已安装的vagrant版本以及当前可用的vagrant最新版本. userdeMacBo ...

  10. virtualbox+vagrant学习-2(command cli)-24-Aliases别名

    Aliases 别名的部分灵感来自Git自身的别名功能,它允许你创建自己的定制vagrant命令,从而使你的vagrant体验更简单.更容易.更熟悉. 别名可以在VAGRANT_HOME/ alias ...

随机推荐

  1. SSM(Spring+SpringMVC+Mybstis)搭建,写给新手

    SSM框架——详细整合教程(Spring+SpringMVC+MyBatis) 作用: SSM框架是spring MVC ,spring和mybatis框架的整合,是标准的MVC模式,将整个系统划分为 ...

  2. .NET中的异步编程

    开篇 异步编程是程序设计的重点也是难点,还记得在刚开始接触.net的时候,看的是一本c#的Winform实例教程,上面大部分都是教我们如何使用Winform的控件以及操作数据库的实例,那时候做的基本都 ...

  3. setInterval和setTimeout的区别以及setInterval越来越快问题的解决方法

    setInterval()和setTimeout()方法都是js原生的定时方法,当然它们两个的作用也是不同的,并且最近在做上下滚动公告栏的时候,发现了setInterval()非常令人抓狂的问题,那就 ...

  4. jQuery 四舍五入

    var a="15.23456789"; var b=a.toFixed(2);/*保留两位小数*/ alert(b); /*返回结果:15.23*/

  5. JavaScript停止冒泡例子

    <!DOCTYPE html><html><head><meta charset="utf-8"><title>qypt ...

  6. CSS 画一个心

    效果图: 实现原理: 可以把这个心分为两部分,两个长方形,分别设置 border-radius,transform: rotate() . 设置属性之后 再次添加一个,设置相反的 rotate 设置其 ...

  7. Difference between ReLU、LReLU、PReLU、CReLU、ELU、SELU

    激活函数 ReLU.LReLU.PReLU.CReLU.ELU.SELU  的定义和区别 ReLU tensorflow中:tf.nn.relu(features, name=None) LReLU ...

  8. 格式化字符串漏洞利用实战之 0ctf-easyprintf

    前言 这是 0ctf 的一道比较简单的格式化串的题目. 正文 逻辑非常简单 do_read 可以打印内存地址的数据,可用来 泄露 got. leave 格式化字符串漏洞. printf(s) 直接调用 ...

  9. Weblogic集群配置__部署润乾应用

     ◆环境: Windows xp Weblogic:wls1031_ccjk_win32.rar(内部下载:\\192.168.0.38\SystemInstaller\4WebServer\we ...

  10. 润乾报表与DERBY数据库的创建连接详解

     1. 问题概述 1.Derby数据库的创建过程 2.润乾报表连接Derby数据库展现数据 概述: Derby是Apache Software Foundation (ASF)的一个的孵化器项目. ...