# -*- mode: ruby -*-
# vi: set ft=ruby :

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

provision_script = <<SCRIPT
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" > /etc/apt/sources.list.d/docker.list
apt-get update
apt-get install -y docker-engine=1.9.1-0~trusty
echo 'deb http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu trusty main' >> /etc/apt/sources.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 0x80f70e11f0f0d5f10cb20e62f5da5f09c3173aa6
apt-get update
apt-get install -y ruby2.2 ruby2.2-dev build-essential ca-certificates libssl-dev
gem install bundler
SCRIPT

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.define "kontena_server" do |docker|
    docker.vm.box = "ubuntu/trusty64"
    docker.vm.network "private_network", ip: "192.168.66.100"
    docker.vm.hostname = "kontena-server"
    docker.vm.provider "virtualbox" do |vb|
      vb.gui = false
      vb.customize ["modifyvm", :id, "--memory", "512"]
      vb.auto_nat_dns_proxy = false
      vb.customize ["modifyvm", :id, "--natdnsproxy1", "off" ]
      vb.customize ["modifyvm", :id, "--natdnshostresolver1", "off" ]
    end
    docker.vm.provision "shell", inline: provision_script
  end
end
