最近学个DEVOPS2.0,讲微服务,容器华,持续部署,很到位,就一个一个工具撸一撸。。。

vagrant,以前接触过,所以上手快,,哈哈,,用时再具体配置。

virtualbox的。

基本命令:

#提前下载好的box文件,~/box/precise64.box,我们给这个box命名为ubuntu12.04
vagrant box add ubuntu12.04 ~/box/precise64.box
#box文件也可以是远程地址 base 为默认名称
#vagrant box add base http://files.vagrantup.com/lucid64.box
#打开目录
#cd ~/vagrant/work
#初始化
vagrant init
#如果你添加的box名称不是base,那么需要在初始化的时候指定名称,例如
vagrant init ubuntu12.04
vagrant up
vagrant ssh
vagrant reload
vagrant package
vagrant  -h

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://atlas.hashicorp.com/search.config.vm.box = "hashicorp/precise64"config.vm.provision :shell, path: "bootstrap.sh"config.vm.network :forwarded_port, guest: 80, host: 4567# 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.# config.vm.network "forwarded_port", guest: 80, host: 8080# 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.# Define a Vagrant Push strategy for pushing to Atlas. Other push strategies# such as FTP and Heroku are also available. See the documentation at# https://docs.vagrantup.com/v2/push/atlas.html for more information.# config.push.define "atlas" do |push|#   push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"# end# 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

bootstrap.sh

#!/usr/bin/env bashapt-get update
apt-get install -y apache2
if ! [ -L /var/www ]; thenrm -rf /var/wwwln -fs /vagrant /var/www
fi

vagrant,流浪汉,我又来啦。相关推荐

  1. vagrant入门_eZ Platform在Vagrant上的入门

    vagrant入门 Last year, I had a somewhat negative experience with installing eZ Publish on a Vagrant bo ...

  2. vagrant + vitrulbox + centos8 部署单机 k8s

    安装环境vagrant+vbox+centos8 安装顺序 说明 链接 1 下载安装windows版vagrant 官网下载 csdn下载 2.2.13有加载插件挂钩的问题不建议安装问题锚点 2 下载 ...

  3. devops包括什么_名字叫什么? DevOps版。

    devops包括什么 I've been working in DevOps for a while now, and I've yet to come across a tool that didn ...

  4. 【英语】托福/GRE单词 近义/形近 分类汇总(更新中......)

    transition 转变 过渡: transmit 传送(信息.信号) 传播(疾病) 传达(思想) transaction 交易 transact 做业务 做交易 translucent 半透明的 ...

  5. VitrualBox、vagrant、homestead的关系

    VitrualBox 是一款非常强大的免费虚拟机软件,使用者可以在 VitrualBox 上安装并运行 Linux.Windows.Mac OS X 等操作系统,类似的软件还有 VMware Vagr ...

  6. 如何在Mac OSX 系统上安装 Vagrant

    翻译&转载:http://sourabhbajaj.com/mac-setup/Vagrant/README.html 如何在Mac OSX 系统上安装 Vagrant 创建和配置轻量级.可重 ...

  7. vagrant打造自己的开发环境~~我也来一发

    缘由: 在网上看到斌哥,爽神都写了关于vagrant的博客,都在说很强大,所以很好奇这玩意怎么个强大,然后也就自己来一发玩玩看看. 真实缘由: 说实话是电脑配置太低,win7系统,3G内存,08年的品 ...

  8. vagrant使用_使用Vagrant的初学者指南

    vagrant使用 Vagrant 将自己描述为"在单个工作流程中构建和管理虚拟机环境的工具.凭借易于使用的工作流程并专注于自动化,Vagrant缩短了开发环境的设置时间,增加了生产平价,并 ...

  9. bash: vagrant_重新引入Vagrant:从PHP开始的正确方法

    bash: vagrant I often get asked to recommend beginner resources for people new to PHP. And, it's tru ...

最新文章

  1. TP框架中field查询字段
  2. ajax: PopupControlExtender使用
  3. matlab eeg信号处理,EEG数据信号的Matlab滤波仿真设计分析研究
  4. Python:目录和文件的操作模块os.path和OS常用方法
  5. 动态规划-时间规整算法
  6. a标签hidden属性_HTML5属性a标签ping被用于DDOS攻击,QQ浏览器被波及
  7. uni-app 微信小程序自定义radio样式
  8. jq之hide(1000)
  9. SpringMVC常用的注解
  10. 软件易容术-----换肤
  11. elasticsearch的javaAPI之index
  12. 打开IIS管理器命令cmd
  13. 西子凌波回复集5(网友整理版)
  14. 深度学习 机器视觉 经典卷积神经网络 Tensorflow2.0 keras.applications
  15. CS1526号错误是什么
  16. 三菱FX5U系列PLC内置高速计数器的使用方法示例
  17. 区块链开发(五)搭建以太坊区块链浏览器
  18. Python中yield的用法详解——最简单,最清晰的解释
  19. 2016OSC源创会年终盛典-前端技术专场-肖光宇
  20. 在微软工作是怎样一番体验

热门文章

  1. logging模块和包
  2. Saiku Table展示数据合并bug修复(二十五)
  3. Thunar 右键菜单等自定义
  4. 从零认识单片机(9)
  5. sqlserver 查询中使用Union或Union All
  6. 使用Lightbox制作照片条
  7. 恶补sql知识(一)
  8. Jsp-Servlet 概要总结[转]
  9. 编写 Servlet 2.3 Filter
  10. java类的结构:构造器 —(13)