]>
Commit | Line | Data |
---|---|---|
f67539c2 TL |
1 | # -*- mode: ruby -*- |
2 | # vi: set ft=ruby : | |
3 | # | |
4 | # Licensed under the Apache License, Version 2.0 (the "License"); | |
5 | # you may not use this file except in compliance with the License. | |
6 | # You may obtain a copy of the License at | |
7 | # | |
8 | # http://www.apache.org/licenses/LICENSE-2.0 | |
9 | # | |
10 | # Unless required by applicable law or agreed to in writing, software | |
11 | # distributed under the License is distributed on an "AS IS" BASIS, | |
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | # See the License for the specific language governing permissions and | |
14 | # limitations under the License. | |
15 | ||
16 | # Base system bootstrap script | |
17 | $bootstrap_script = <<__BOOTSTRAP__ | |
18 | echo "Provisioning defaults" | |
19 | ||
20 | sudo apt-get update -y | |
21 | sudo apt-get upgrade -y | |
22 | ||
23 | # Install default packages | |
24 | sudo apt-get install -y build-essential curl git | |
25 | ||
26 | # Install latest Docker version | |
27 | sudo curl -sSL https://get.docker.io/gpg | sudo apt-key add - | |
28 | sudo echo "deb http://get.docker.io/ubuntu docker main" > /etc/apt/sources.list.d/docker.list | |
29 | sudo apt-get update -y | |
30 | sudo apt-get install -y linux-image-extra-`uname -r` aufs-tools | |
31 | sudo apt-get install -y lxc-docker | |
32 | ||
33 | echo "Finished provisioning defaults" | |
34 | __BOOTSTRAP__ | |
35 | ||
36 | Vagrant.configure("2") do |config| | |
37 | config.vm.box = "trusty64" | |
38 | config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box" | |
39 | config.ssh.forward_agent = true | |
40 | ||
41 | config.vm.provider :virtualbox do |vbox| | |
42 | vbox.customize ["modifyvm", :id, "--memory", "1024"] | |
43 | vbox.customize ["modifyvm", :id, "--cpus", "2"] | |
44 | end | |
45 | ||
46 | # Setup the default bootstrap script for our ubuntu base box image | |
47 | config.vm.provision "shell", inline: $bootstrap_script | |
48 | ||
49 | # Setup the custom docker image from our Ubuntu Dockerfile | |
50 | config.vm.provision "docker" do |d| | |
51 | d.build_image "/vagrant/ubuntu", args: "-t thrift" | |
52 | end | |
53 | ||
54 | # Setup the custom docker image from our Centos Dockerfile | |
55 | #config.vm.provision "docker" do |d| | |
56 | # d.build_image "/vagrant/centos", args: "-t thrift-centos" | |
57 | #end | |
58 | ||
59 | end |