Automatically install Docker in the recommended fashion
authorMatt Palmer <mpalmer@hezmatt.org>
Mon, 14 Sep 2015 05:32:51 +0000 (15:32 +1000)
committerMatt Palmer <mpalmer@hezmatt.org>
Mon, 14 Sep 2015 05:32:51 +0000 (15:32 +1000)
This should be enough to ensure that, if this install method were to
become unavailable in the future, we'd know about it and could alter
our other documentation.

Vagrantfile

index 42a0655c02a2cbc7867a22aed2dc18980b36993c..106b625b58cfef6eb86d1dd021c3a19bcd3d61e9 100644 (file)
@@ -1,5 +1,5 @@
 Vagrant.configure(2) do |config|
-  config.vm.define :ubuntu do |config|
+  config.vm.define :dockerhost do |config|
     config.vm.box = "trusty64"
     config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
 
@@ -15,13 +15,14 @@ Vagrant.configure(2) do |config|
       apt-get update
       apt-get -y remove --purge puppet juju
       apt-get -y autoremove --purge
+      wget -qO- https://get.docker.com/ | sh
     EOF
-  end
 
-  if ENV["http_proxy"]
-    config.vm.provision "shell", inline: <<-EOF
-      echo "Acquire::http::Proxy \\"#{ENV['http_proxy']}\\";" >/etc/apt/apt.conf.d/50proxy
-      echo "http_proxy=\"#{ENV['http_proxy']}\"" >/etc/profile.d/http_proxy.sh
-    EOF
+    if ENV["http_proxy"]
+      config.vm.provision "shell", inline: <<-EOF
+        echo "Acquire::http::Proxy \\"#{ENV['http_proxy']}\\";" >/etc/apt/apt.conf.d/50proxy
+        echo "http_proxy=\"#{ENV['http_proxy']}\"" >/etc/profile.d/http_proxy.sh
+      EOF
+    end
   end
 end