Created
June 21, 2016 05:29
-
-
Save tcahill/3c9f5e5ac0e8b212f18e66959959d118 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
$script = <<SCRIPT | |
source /home/vagrant/.bashrc | |
if [ ! -d /usr/local/go ]; then | |
echo "Installing Go..." | |
wget https://storage.googleapis.com/golang/go1.6.2.linux-amd64.tar.gz -O /usr/local/go.tar.gz | |
cd /usr/local && tar xvf go.tar.gz | |
echo "export PATH=\\$PATH:/usr/local/go/bin" >> /home/vagrant/.bashrc | |
CGO_ENABLED=0 sudo /usr/local/go/bin/go install -a -installsuffix cgo std | |
fi | |
if [ ! -d /home/vagrant/go/src/k8s.io/kubernetes/third_party/etcd ]; then | |
echo "Installing etcd..." | |
cd /home/vagrant/go/src/k8s.io/kubernetes && hack/install-etcd.sh | |
echo "export PATH=\\$PATH:/home/vagrant/go/src/k8s.io/kubernetes/third_party/etcd" >> /home/vagrant/.bashrc | |
fi | |
if ! which docker &> /dev/null; then | |
echo "Installing Docker..." | |
sudo apt-get update | |
sudo apt-get install apt-transport-https ca-certificates | |
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
sudo bash -c "echo 'deb https://apt.dockerproject.org/repo ubuntu-trusty main' > /etc/apt/sources.list.d/docker.list" | |
sudo apt-get update | |
sudo apt-get -y --force-yes install docker-engine | |
fi | |
SCRIPT | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.synced_folder "#{ENV['GOPATH']}/src/k8s.io/kubernetes", "/home/vagrant/go/src/k8s.io/kubernetes" | |
config.vm.provision "shell", inline: $script | |
config.vm.provider "virtualbox" do |v| | |
v.memory = 4096 | |
v.cpus = 2 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment