Vagrant搭建LNMP开发环境

Vagrant搭建LNMP开发环境

  • 使用Vagrant开发环境之前必须明白

vagrant封装的镜像里面保存的东西是永久的,比如日志什么的.所以一旦磁盘满了之后很麻烦.

所以一般我都是用docker做开发环境

[TOC]

自动创建镜像

通过vagrant官方镜像安装

可以通过命令自动安装,也可以去下载https://app.vagrantup.com/boxes/search

vagrant box add bento/ubuntu-16.04
或
这个也是16.04
vagrant box add ubuntu/xenial64

通过URL地址安装

vagrant box add URL
比如

通过本地镜像安装

这种方式,可以用别人发的.也可以在官网速度慢的时候,先下载下来, 再用这种方式在本地安装.

vagrant box add {box_name} {file_path}

手动创建镜像

来源:

https://github.com/mcandre/packer-templates

比较方便的方式是,直接把这个github里面的内容clone下来做即可.

首先需要安装 packer

Mac下安装

brew install packer

其他系统前往手动下载

https://www.packer.io/downloads.html

常用参数解读

这里只几下几个常用的,剩下的见名知意即可.

ubuntu-amd64

执行打包命令

packer build -force -only virtualbox-iso centos-amd64.json

打包命令所以来的脚本和配置文件

注意下面依赖三个bash脚本,这个三个进程是用来修改系统内部环境的脚本.

  • fix-vagrant-ssh.ubuntu.sh
  • fix-sudo.ubuntu.sh
  • cleanup.ubuntu.sh
  • fix-dhcp.ubuntu.sh 如果需要的话可以在provisioners的scripts中添加这个脚本
  • 同时也需要一个Vagrantfile

如果下面的iso_url失效的话,可以去ubuntu官网(http://releases.ubuntu.com)替换为最新的URL地址

别忘了替换iso_checksum_url

如果觉得官方地址下载的慢,也可以替换为国内的163和阿里云等链接.

官方给的Vagrantfile,但是一般我都用自己配的那个

Vagrant.configure("2") do |config|
    config.vm.synced_folder ".", "/vagrant", type: "rsync"
end

ubuntu-amd64.json

{
  "variables": {
    "vm_name": "ubuntu-amd64",
    "iso_url": "http://releases.ubuntu.com/18.04/ubuntu-18.04.2-live-server-amd64.iso",
    "iso_checksum_type": "sha256",
    "iso_checksum_url": "http://releases.ubuntu.com/18.04.2/SHA256SUMS",
    "ssh_username": "vagrant",
    "ssh_password": "vagrant",
    "ssh_wait_timeout": "6h",
    "disk_size_MB": "8000",
    "ram_MiB": "1024",
    "boot_wait": "60s",
    "shutdown_command": "echo 'vagrant' | sudo -S halt -p"
  },
  "provisioners": [
    {
      "type": "shell",
      "execute_command": "echo 'vagrant' | {{ .Vars }} sudo -ES sh {{.Path}}",
      "scripts": [
        "fix-vagrant-ssh.ubuntu.sh",
        "fix-sudo.ubuntu.sh",
        "cleanup.ubuntu.sh"
      ]
    }
  ],
  "post-processors": [
    {
      "type": "vagrant",
      "output": "{{ user `vm_name` }}-{{.Provider}}.box",
      "compression_level": "9",
      "vagrantfile_template": "Vagrantfile"
    }
  ],
  "builders": [
    {
      "type": "virtualbox-iso",
      "guest_os_type": "Ubuntu_64",
      "vm_name": "{{ user `vm_name` }}",
      "iso_url": "{{ user `iso_url` }}",
      "iso_checksum_type": "{{ user `iso_checksum_type` }}",
      "iso_checksum_url": "{{ user `iso_checksum_url` }}",
      "ssh_username": "{{ user `ssh_username` }}",
      "ssh_password": "{{ user `ssh_password` }}",
      "ssh_wait_timeout": "{{ user `ssh_wait_timeout` }}",
      "disk_size": "{{ user `disk_size_MB` }}",
      "guest_additions_mode": "disable",
      "virtualbox_version_file": "",
      "vboxmanage": [ ["modifyvm", "{{.Name}}", "--memory", "{{ user `ram_MiB` }}"] ],
      "boot_wait": "{{ user `boot_wait` }}",
      "boot_command": [
        "<enter><wait>",
        "<enter><wait10>",
        "<enter><wait>",
        "<enter><wait5>",
        "<enter><wait>",
        "<enter><wait>",
        "<enter><wait>",
        "<enter><wait>",
        "<down><wait>",
        "<enter><wait>",
        "Vagrant<tab>",
        "vagrant<tab>",
        "{{ user `ssh_username` }}<tab>",
        "{{ user `ssh_password` }}<tab>",
        "{{ user `ssh_password` }}<tab>",
        "<tab><enter>",
        "<wait300>",
        "<enter><wait10>",
        "<enter>"
      ],
      "shutdown_command": "{{ user `shutdown_command` }}"
    }
  ]
}

fix-vagrant-ssh.ubuntu.sh

#!/bin/sh
apt-get update &&
    apt-get install -y ca-certificates &&
    mkdir -p /home/vagrant/.ssh &&
    wget -O /home/vagrant/.ssh/authorized_keys https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub &&
    chown -R vagrant:vagrant /home/vagrant/.ssh &&
    chmod 0700 /home/vagrant/.ssh &&
    chmod 0600 /home/vagrant/.ssh/authorized_keys &&
    apt-get purge -y ca-certificates

fix-sudo.ubuntu.sh

#!/bin/sh
sed -i -E -e 's/%sudo[[:space:]]+ALL=\(ALL:ALL\)[[:space:]]+ALL/%sudo ALL=(ALL:ALL) NOPASSWD:ALL/' /etc/sudoers

cleanup.ubuntu.sh

#!/bin/sh

# Remove non-critical packages and clear cache
apt-mark manual openssh-server &&
apt-get purge -y \
    tasksel \
    tasksel-data \
    task-laptop \
    task-english \
    bsdmainutils \
    pciutils \
    libx11-data \
    xauth \
    libxmuu1 \
    libxcb1 \
    libx11-6 \
    libxext6 \
    man-db \
    nano \
    whereami \
    whiptail \
    perl \
    make-guile \
    kbd \
    keyboard-configuration \
    lvm2 \
    eject \
    discover \
    dmidecode \
    tcpd \
    busybox \
    installation-report \
    wget \
    wireless-tools \
    wpasupplicant &&
    dpkg --list |
    awk '{ print $2 }' |
    grep -- '-dev' |
    xargs apt-get purge -y &&
    dpkg --list |
    egrep 'linux-image-[0-9]' |
    awk '{ print $3,$2 }' |
    sort -nr |
    tail -n +2 |
    grep -v "$(uname -r)" |
    awk '{ print $2 }' |
    xargs apt-get purge -y &&
    apt-get autoremove --purge -y &&
    dpkg --list |
    grep '^rc' |
    awk '{ print $2 }' |
    xargs apt-get purge -y &&
    apt-get autoclean -y &&
    apt-get clean -y &&
    rm -rf /var/lib/apt/lists/* \
        /var/cache/apt/pkgcache.bin \
        /var/cache/apt/srcpkgcache.bin

# Prevent scheduled apt executions from colliding with manual apt executions
systemctl disable apt-daily.service &&
    systemctl disable apt-daily.timer

# Delete leftover documentation
find /usr/share/doc -depth -type f ! -name copyright |
    xargs rm ||
    echo 'Deleted non-copyright documentation' &&
    find /usr/share/doc -empty |
    xargs rmdir ||
    echo 'Delted empty documentation' &&
    rm -rf /usr/share/man/* \
        /usr/share/groff/* \
        /usr/share/info/* \
        /usr/share/lintian/* \
        /usr/share/linda/* \
        /var/cache/man/*

# Clear network cache, help DHCP load, accelerate vagrant ssh, accelerate GRUB
mkdir /etc/udev/rules.d/70-persistent-net.rules &&
    rm -rf /dev/.udev \
        /var/lib/dhcp/* \
        /var/lib/dhcp3/* &&
    echo 'pre-up sleep 2' >>/etc/network/interfaces &&
    echo 'UseDNS no' >>/etc/ssh/sshd_config &&
    sed -i 's/GRUB_TIMEOUT=5/GRUB_TIMEOUT=0/' /etc/default/grub &&
    grub-mkconfig -o /boot/grub/grub.cfg

# Clear log files
find /var/log -type f | xargs truncate -s 0

# Clear temporary files
rm -rf /tmp/*

# Shrink rootfs
count="$(df --sync -kP / | tail -n1 | awk -F ' ' '{ print $4 }')" &&
    count="$(($count - 1))" &&
    dd if=/dev/zero of=/tmp/whitespace bs=1024 count="$count" ||
    echo 'Zeroed rootfs' &&
    rm /tmp/whitespace

# Shrink boot partition
count="$(df --sync -kP /boot | tail -n1 | awk -F ' ' '{ print $4 }')" &&
    count="$(($count - 1))" &&
    dd if=/dev/zero of=/boot/whitespace bs=1024 count="$count" ||
    echo 'Zeroed boot partition' &&
    rm /boot/whitespace

# Shrink swap space
swapuuid="$(/sbin/blkid -o value -l -s UUID -t TYPE=swap)" &&
    swappart="$(readlink -f "/dev/disk/by-uuid/${swapuuid}")" &&
    /sbin/swapoff "$swappart" &&
    dd if=/dev/zero of="$swappart" bs=1M ||
    echo 'Zeroed swap space' &&
    /sbin/mkswap -U "$swapuuid" "$swappart"

# Shrink root partition and persist disks
dd if=/dev/zero of=/whitespace bs=1M ||
    echo 'Zeroed disk' &&
    rm -f /whitespace &&
    sync

fix-dhcp.ubuntu.sh 如果需要也可以把这个脚本添加进去

#!/bin/sh
printf "#!/bin/sh\ndhclient\nexit 0\n" >>/etc/rc.local &&
    chmod 0755 /etc/rc.local

centos-amd64

执行打包命令

packer build -force -only virtualbox-iso centos-amd64.json

打包命令所以来的脚本和配置文件

Vagrantfile

官方给的Vagrantfile,但是一般我都用自己配的那个

Vagrant.configure("2") do |config|
    config.vm.synced_folder ".", "/vagrant", type: "rsync"
end

centos-amd64.json

{
    "variables": {
        "vm_name": "centos-amd64",
        "iso_url": "http://mirrors.mit.edu/centos/7/isos/x86_64/CentOS-7-x86_64-Minimal-1804.iso",
        "iso_checksum_type": "sha256",
        "iso_checksum_url": "http://mirrors.mit.edu/centos/7/isos/x86_64/sha256sum.txt",
        "ssh_username": "vagrant",
        "ssh_password": "vagrant",
        "ssh_wait_timeout": "6h",
        "disk_size_MB": "8000",
        "ram_MiB": "1024",
        "http_directory": "http",
        "shutdown_command": "echo 'vagrant' | sudo -S halt -p"
    },
    "provisioners": [
        {
            "type": "shell",
            "execute_command": "echo 'vagrant' | {{ .Vars }} sudo -ES sh {{.Path}}",
            "scripts": [
                "fix-vagrant-ssh.centos.sh",
                "cleanup.centos.sh"
            ]
        }
    ],
    "post-processors": [
        {
            "type": "vagrant",
            "output": "{{ user `vm_name` }}-{{.Provider}}.box",
            "compression_level": "9",
            "vagrantfile_template": "Vagrantfile"
        }
    ],
    "builders": [
        {
            "type": "virtualbox-iso",
            "guest_os_type": "RedHat_64",
            "vm_name": "{{ user `vm_name` }}",
            "iso_url": "{{ user `iso_url` }}",
            "iso_checksum_type": "{{ user `iso_checksum_type` }}",
            "iso_checksum_url": "{{ user `iso_checksum_url` }}",
            "ssh_username": "{{ user `ssh_username` }}",
            "ssh_password": "{{ user `ssh_password` }}",
            "ssh_wait_timeout": "{{ user `ssh_wait_timeout` }}",
            "disk_size": "{{ user `disk_size_MB` }}",
            "guest_additions_mode": "disable",
            "virtualbox_version_file": "",
            "vboxmanage": [ ["modifyvm", "{{.Name}}", "--memory", "{{ user `ram_MiB` }}"] ],
            "http_directory": "{{ user `http_directory` }}",
            "boot_command": "<tab> ks=http://{{.HTTPIP}}:{{.HTTPPort}}/ks.cfg<enter>",
            "shutdown_command": "{{ user `shutdown_command` }}"
        }
    ]
}

cleanup.centos.sh

#!/bin/sh

# Clear log files
find /var/log -type f | xargs truncate -s 0

# Clear temporary files
rm -rf /tmp/*

# Shrink rootfs
count="$(df --sync -kP / | tail -n1 | awk -F ' ' '{ print $4 }')" &&
    count="$(($count - 1))" &&
    dd if=/dev/zero of=/tmp/whitespace bs=1024 count="$count" ||
    echo 'Zeroed rootfs' &&
    rm /tmp/whitespace

# Shrink boot partition
count="$(df --sync -kP /boot | tail -n1 | awk -F ' ' '{ print $4 }')" &&
    count="$(($count - 1))" &&
    dd if=/dev/zero of=/boot/whitespace bs=1024 count="$count" ||
    echo 'Zeroed boot partition' &&
    rm /boot/whitespace

# Shrink swap space
swapuuid="$(/sbin/blkid -o value -l -s UUID -t TYPE=swap)" &&
    swappart="$(readlink -f "/dev/disk/by-uuid/${swapuuid}")" &&
    /sbin/swapoff "$swappart" &&
    dd if=/dev/zero of="$swappart" bs=1M ||
    echo 'Zeroed swap space' &&
    /sbin/mkswap -U "$swapuuid" "$swappart"

# Shrink root partition and persist disks
dd if=/dev/zero of=/whitespace bs=1M ||
    echo 'Zeroed disk' &&
    rm -f /whitespace &&
    sync

fix-vagrant-ssh.centos.sh

#!/bin/sh
yum update -y &&
    yum install -y wget &&
    mkdir -p /home/vagrant/.ssh &&
    wget -O /home/vagrant/.ssh/authorized_keys https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub &&
    chown -R vagrant:vagrant /home/vagrant/.ssh &&
    chmod 0700 /home/vagrant/.ssh &&
    chmod 0600 /home/vagrant/.ssh/authorized_keys &&
    yum remove -y wget &&
    yum clean all

centos-i386.json

同样需要上面centos的

  • Vagrantfile
  • cleanup.centos.sh
  • fix-vagrant-ssh.centos.sh
{
    "variables": {
        "vm_name": "centos-i386",
        "iso_url": "http://mirror.centos.org/altarch/7/isos/i386/CentOS-7-i386-Minimal-1804.iso",
        "iso_checksum_type": "sha256",
        "iso_checksum_url": "http://mirror.centos.org/altarch/7/isos/i386/sha256sum.txt",
        "ssh_username": "vagrant",
        "ssh_password": "vagrant",
        "ssh_wait_timeout": "6h",
        "disk_size_MB": "8000",
        "ram_MiB": "1024",
        "http_directory": "http",
        "shutdown_command": "echo 'vagrant' | sudo -S halt -p"
    },
    "provisioners": [
        {
            "type": "shell",
            "execute_command": "echo 'vagrant' | {{ .Vars }} sudo -ES sh {{.Path}}",
            "scripts": [
                "fix-vagrant-ssh.centos.sh",
                "cleanup.centos.sh"
            ]
        }
    ],
    "post-processors": [
        {
            "type": "vagrant",
            "output": "{{ user `vm_name` }}-{{.Provider}}.box",
            "compression_level": "9",
            "vagrantfile_template": "Vagrantfile"
        }
    ],
    "builders": [
        {
            "type": "virtualbox-iso",
            "guest_os_type": "RedHat",
            "vm_name": "{{ user `vm_name` }}",
            "iso_url": "{{ user `iso_url` }}",
            "iso_checksum_type": "{{ user `iso_checksum_type` }}",
            "iso_checksum_url": "{{ user `iso_checksum_url` }}",
            "ssh_username": "{{ user `ssh_username` }}",
            "ssh_password": "{{ user `ssh_password` }}",
            "ssh_wait_timeout": "{{ user `ssh_wait_timeout` }}",
            "disk_size": "{{ user `disk_size_MB` }}",
            "guest_additions_mode": "disable",
            "virtualbox_version_file": "",
            "vboxmanage": [ ["modifyvm", "{{.Name}}", "--memory", "{{ user `ram_MiB` }}"] ],
            "http_directory": "{{ user `http_directory` }}",
            "boot_command": "<tab> ks=http://{{.HTTPIP}}:{{.HTTPPort}}/ks.cfg<enter>",
            "shutdown_command": "{{ user `shutdown_command` }}"
        }
    ]
}

准备 Vagrantfile

注意这里也是需要 Vagrantfile 的

这是官方的github推荐的, 但是一般我都用那个我自己配置的.


Vagrant.configure("2") do |config|
    config.vm.synced_folder ".", "/vagrant", type: "rsync"
end

开始打包

packer build -only=virtualbox-iso ubuntu-16.04-amd64.json

用 virtualBox 虚拟机导出的方式创建vagrant的box镜像

查看 virtualBox 都有什么镜像

vboxmanage list vms

通过得到的虚拟机镜像名称导出镜像为vagrant的box镜像

  • –-base 代表本地
  • Ubuntu-Server16.04 是你要导出的box的名称
  • –output代表导出
  • ./Ubuntu16.04.box 表示导出后的box名为Ubuntu.box ,并保存在当前目录下
vagrant package -–base Ubuntu-Server16.04 –output ./Ubuntu.box 

vagrant的安装部署

  1. 安装 VirtualBox

虚拟机还是得依靠 VirtualBox 来搭建,免费小巧。 下载地址:https://www.virtualbox.org/wiki/Downloads

提示:虽然 Vagrant 也支持 VMware,不过 VMware 是收费的,对应的 Vagrant 版本也是收费的

  1. 安装 Vagrant 并添加镜像

下载地址:https://www.vagrantup.com/downloads.html 根据提示一步步安装。

装好以后运行 vagrant box add hashicorp/precise64

添加 Vagrant 官方的 box 镜像。这时将从官网下载名为 hashicorp/precise64 的 box,可能需要等待一段时间。

如果你要其他系统的镜像,可以来这里查询下载:https://atlas.hashicorp.com/boxes/search

提示:如果你因为网络原因添加不了上面的镜像,可以用工具将这些 box 下载下来(下载地址),参照后文的“打包分发”部分进行添加

  1. 初始化开发环境 创建一个开发目录(比如:~/dev),你也可以使用已有的目录,切换到开发目录里,用 hashicorp/precise64 镜像初始化当前目录的环境:
$ cd ~/dev  # 切换目录
$ vagrant init hashicorp/precise64  # 用 hashicorp/precise64 进行 box 初始化
$ vagrant up  # 启动环境

# vagrant up 的时候会输出相关信息,包含ssh连接地址和用户名密码等
# default: SSH address: 127.0.0.1:2222
# default: SSH username: vagrant
# default: SSH auth method: password

你会看到终端显示了启动过程,启动完成后,我们就可以用 SSH 登录虚拟机了,剩下的步骤就是在虚拟机里配置你要运行的各种环境和参数了。

$ vagrant ssh  # SSH 登录
$ cd /vagrant  # 切换到开发目录,也就是宿主机上的 `~/dev`

~/dev 目录对应虚拟机中的目录是 /vagrant

  • Windows 用户注意:Windows 终端并不支持 ssh,所以需要安装第三方 SSH 客户端,比如:Putty、Cygwin 等。

打包分发

当你配置好开发环境后,退出并关闭虚拟机。在终端里对开发环境进行打包:

$ vagrant package

打包完成后会在当前目录生成一个 package.box 的文件,将这个文件传给其他用户,其他用户只要添加这个 box 并用其初始化自己的开发目录就能得到一个一模一样的开发环境了。

添加方法:

假设我们拿到的 box 存放路径是 ~/box/package.box,在终端里输入:

必要的时候比如要强制覆盖当前已有名字的镜像时可以使用--force命令

$ vagrant box add hahaha ~/box/package.box  # 添加 package.box 镜像并命名为 hahaha
$ cd ~/dev  # 切换到项目目录
$ vagrant init hahaha  # 用 hahaha 镜像初始化

其他设置 Vagrant 初始化成功后,会在初始化的目录里生成一个 Vagrantfile 的配置文件,可以修改配置文件进行个性化的定制。

Vagrant 默认是使用端口映射方式将虚拟机的端口映射本地从而实现类似 http://localhost:80 这种访问方式,这种方式比较麻烦,新开和修改端口的时候都得编辑。相比较而言,host-only 模式显得方便多了。打开 Vagrantfile,将下面这行的注释去掉(移除 #)并保存:

config.vm.network :private_network, ip: "192.168.33.10"

重启虚拟机,这样我们就能用 192.168.33.10 访问这台机器了,你可以把 IP 改成其他地址,只要不产生冲突就行。

常用命令

# vagrant up 的时候会输出相关信息,包含ssh连接地址和用户名密码等
# default: SSH address: 127.0.0.1:2222
# default: SSH username: vagrant
# default: SSH auth method: password
$ vagrant init      # 初始化
$ vagrant up        # 启动虚拟机
$ vagrant halt      # 关闭虚拟机
$ vagrant reload    # 重启虚拟机
$ vagrant ssh       # SSH 至虚拟机
$ vagrant status    # 查看虚拟机运行状态
$ vagrant destroy   # 销毁当前虚拟机

$ vagrant box add       # 添加镜像 可以使用--force强行覆盖已存在的重名镜像
$ vagrant box list      # 查看已添加的所有镜像
$ vagrant box outdated
$ vagrant box prune     # 删除已安装的老旧镜像
$ vagrant box remove    # 删除指定的镜像
$ vagrant box repackage
$ vagrant box update

Vagrantfile配置文件常用参数解读

Vagrantfile

# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.
  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://vagrantcloud.com/search.
  # 镜像名称
  config.vm.box = "box文件文件名"
  # ssh用户名
  config.ssh.username = "vagrant"
  # ssh密码
  config.ssh.password = "vagrant"
  # 设置为私有网络, 仅限宿主机访问
  #config.vm.network "private_network", ip: "10.10.1.8"
  # 设置为共有公网,限局域网所有人可访问,后面不写IP,代表自动生成IP
  config.vm.network "public_network"
  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  # config.vm.box_check_update = false
  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  # NOTE: This will enable public access to the opened port
  # config.vm.network "forwarded_port", guest: 80, host: 8080
  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine and only allow access
  # via 127.0.0.1 to disable public access
  # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  # config.vm.network "private_network", ip: "192.168.33.10"
  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # config.vm.network "public_network"
  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  # config.vm.synced_folder "../data", "/vagrant_data"
  # Provider-specific configuration so you can fine-tune various
  # backing providers for Vagrant. These expose provider-specific options.
  # Example for VirtualBox:
  #
  # config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
  #   vb.gui = true
  #
  #   # Customize the amount of memory on the VM:
  #   vb.memory = "1024"
  # end
  #
  # View the documentation for the provider you are using for more
  # information on available options.
  # Enable provisioning with a shell script. Additional provisioners such as
  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
  # documentation for more information about their specific syntax and use.
  # config.vm.provision "shell", inline: <<-SHELL
  #   apt-get update
  #   apt-get install -y apache2
  # SHELL
end

转载于:https://my.oschina.net/chinaliuhan/blog/3066035

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值