zoukankan      html  css  js  c++  java
  • vagrant入门


    introduce:
      https://www.vagrantup.com/intro/index.html

    get started
        https://www.vagrantup.com/intro/getting-started/index.html
        $ vagrant init hashicorp/precise64
        $ vagrant up

    Project Setup
        https://www.vagrantup.com/intro/getting-started/project_setup.html
        $ mkdir vagrant_getting_started
        $ cd vagrant_getting_started
        $ vagrant init hashicorp/precise64

    Boxes
        https://www.vagrantup.com/intro/getting-started/boxes.html
        $ vagrant box add hashicorp/precise64

        Open the Vagrantfile and change the contents to the following
        Vagrant.configure("2") do |config|
          config.vm.box = "hashicorp/precise64"
          config.vm.box_version = "1.1.0"
        end

        Vagrant.configure("2") do |config|
          config.vm.box = "hashicorp/precise64"
          config.vm.box_url = "https://vagrantcloud.com/hashicorp/precise64"
        end

        Discover Vagrant Boxes
        https://vagrantcloud.com/boxes/search


    Up And SSH
        https://www.vagrantup.com/intro/getting-started/up.html
        $ vagrant up
        $ vagrant ssh


    Synced Folders
        https://www.vagrantup.com/intro/getting-started/synced_folders.html

        By default, Vagrant shares your project directory (remember, that is the one with the Vagrantfile) to the /vagrant directory in your guest machine.

    Provisioning
        https://www.vagrantup.com/intro/getting-started/provisioning.html
         Installing Apache
        bootstrap.sh
        #!/usr/bin/env bash

        apt-get update
        apt-get install -y apache2
        if ! [ -L /var/www ]; then
          rm -rf /var/www
          ln -fs /vagrant /var/www
        fi

        Vagrantfile
        Vagrant.configure("2") do |config|
          config.vm.box = "hashicorp/precise64"
          config.vm.provision :shell, path: "bootstrap.sh"
        end

         vagrant up to create your machine and Vagrant will automatically provision it.
         If the guest machine is already running from a previous step, run vagrant reload --provision

         so that you can use your own browser to access the guest machine.

    Networking
        https://www.vagrantup.com/intro/getting-started/networking.html
        use Vagrant's networking features to give us additional options for accessing the machine from our host machine.
        Port Forwarding

        Vagrant.configure("2") do |config|
          config.vm.box = "hashicorp/precise64"
          config.vm.provision :shell, path: "bootstrap.sh"
          config.vm.network :forwarded_port, guest: 80, host: 4567
        end

        Run a vagrant reload or vagrant up (depending on if the machine is already running) so that these changes can take effect.

        Other Networking
        https://www.vagrantup.com/docs/networking/

    Share
        https://www.vagrantup.com/intro/getting-started/share.html

    Teardown
        https://www.vagrantup.com/intro/getting-started/teardown.html
        vagrant suspend
        vagrant halt
        vagrant destroy




  • 相关阅读:
    计总与排名SUM和RANK函数
    计算获取最小值和最大值
    列值中获取第一个非空的值
    连续数字使用连接符替换
    展开中断或忽略的序号
    以连接字符截取字符串
    逗号分割字符串经存储过程存入数据表中
    符号分割的字符串转换为XML
    MS SQL Server的STRING_SPLIT和STRING_AGG函数
    MS SQL Server的LTRIM,RTRIM和TRIM函数
  • 原文地址:https://www.cnblogs.com/pascal1000/p/10851280.html
Copyright © 2011-2022 走看看