vagrant,流浪汉,我又来啦。
最近学个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,流浪汉,我又来啦。相关推荐
- vagrant入门_eZ Platform在Vagrant上的入门
vagrant入门 Last year, I had a somewhat negative experience with installing eZ Publish on a Vagrant bo ...
- vagrant + vitrulbox + centos8 部署单机 k8s
安装环境vagrant+vbox+centos8 安装顺序 说明 链接 1 下载安装windows版vagrant 官网下载 csdn下载 2.2.13有加载插件挂钩的问题不建议安装问题锚点 2 下载 ...
- devops包括什么_名字叫什么? DevOps版。
devops包括什么 I've been working in DevOps for a while now, and I've yet to come across a tool that didn ...
- 【英语】托福/GRE单词 近义/形近 分类汇总(更新中......)
transition 转变 过渡: transmit 传送(信息.信号) 传播(疾病) 传达(思想) transaction 交易 transact 做业务 做交易 translucent 半透明的 ...
- VitrualBox、vagrant、homestead的关系
VitrualBox 是一款非常强大的免费虚拟机软件,使用者可以在 VitrualBox 上安装并运行 Linux.Windows.Mac OS X 等操作系统,类似的软件还有 VMware Vagr ...
- 如何在Mac OSX 系统上安装 Vagrant
翻译&转载:http://sourabhbajaj.com/mac-setup/Vagrant/README.html 如何在Mac OSX 系统上安装 Vagrant 创建和配置轻量级.可重 ...
- vagrant打造自己的开发环境~~我也来一发
缘由: 在网上看到斌哥,爽神都写了关于vagrant的博客,都在说很强大,所以很好奇这玩意怎么个强大,然后也就自己来一发玩玩看看. 真实缘由: 说实话是电脑配置太低,win7系统,3G内存,08年的品 ...
- vagrant使用_使用Vagrant的初学者指南
vagrant使用 Vagrant 将自己描述为"在单个工作流程中构建和管理虚拟机环境的工具.凭借易于使用的工作流程并专注于自动化,Vagrant缩短了开发环境的设置时间,增加了生产平价,并 ...
- bash: vagrant_重新引入Vagrant:从PHP开始的正确方法
bash: vagrant I often get asked to recommend beginner resources for people new to PHP. And, it's tru ...
最新文章
- TP框架中field查询字段
- ajax: PopupControlExtender使用
- matlab eeg信号处理,EEG数据信号的Matlab滤波仿真设计分析研究
- Python:目录和文件的操作模块os.path和OS常用方法
- 动态规划-时间规整算法
- a标签hidden属性_HTML5属性a标签ping被用于DDOS攻击,QQ浏览器被波及
- uni-app 微信小程序自定义radio样式
- jq之hide(1000)
- SpringMVC常用的注解
- 软件易容术-----换肤
- elasticsearch的javaAPI之index
- 打开IIS管理器命令cmd
- 西子凌波回复集5(网友整理版)
- 深度学习 机器视觉 经典卷积神经网络 Tensorflow2.0 keras.applications
- CS1526号错误是什么
- 三菱FX5U系列PLC内置高速计数器的使用方法示例
- 区块链开发(五)搭建以太坊区块链浏览器
- Python中yield的用法详解——最简单,最清晰的解释
- 2016OSC源创会年终盛典-前端技术专场-肖光宇
- 在微软工作是怎样一番体验