From bb73dab8d3529e4f0ba6754be2c0b6c81d5ea6fa Mon Sep 17 00:00:00 2001 From: David Manouchehri Date: Wed, 29 Nov 2017 21:28:38 -0500 Subject: [PATCH 1/8] Added initial Vagrant support. Signed-off-by: David Manouchehri --- Vagrantfile | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Vagrantfile diff --git a/Vagrantfile b/Vagrantfile new file mode 100644 index 000000000..95b03764d --- /dev/null +++ b/Vagrantfile @@ -0,0 +1,33 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : +# Author: David Manouchehri + +Vagrant.configure("2") do |config| + config.vm.box = "bento/ubuntu-16.04" + + config.vm.synced_folder ".", "/vagrant", disabled: true + + config.vm.provision "shell", inline: <<-SHELL + apt-get update + DEBIAN_FRONTEND=noninteractive apt-get -y upgrade + snap install --classic go + apt-get clean + SHELL + + config.vm.provision "docker" + + config.vm.provision "shell", privileged: false, inline: <<-SHELL + go get -u github.com/linuxkit/linuxkit/src/cmd/linuxkit + echo "export PATH=${PATH}:/home/`whoami`/go/bin" >> ~/.bashrc + SHELL + + %w(vmware_fusion vmware_workstation vmware_appcatalyst).each do |provider| + config.vm.provider provider do |v| + v.vmx["vhv.enable"] = "TRUE" + v.vmx['ethernet0.virtualDev'] = 'vmxnet3' + end + end + + config.vm.provider "virtualbox" + config.vm.provider "hyperv" +end From 899d62352ea547e4d7e47f3d96aef321d79cc149 Mon Sep 17 00:00:00 2001 From: David Manouchehri Date: Wed, 29 Nov 2017 21:58:18 -0500 Subject: [PATCH 2/8] Improve vagrant up time by skipping (possibly) unneeded updates. Signed-off-by: David Manouchehri --- Vagrantfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 95b03764d..10390d3d8 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -8,10 +8,10 @@ Vagrant.configure("2") do |config| config.vm.synced_folder ".", "/vagrant", disabled: true config.vm.provision "shell", inline: <<-SHELL - apt-get update - DEBIAN_FRONTEND=noninteractive apt-get -y upgrade + # apt-get update + # DEBIAN_FRONTEND=noninteractive apt-get -y upgrade snap install --classic go - apt-get clean + # apt-get clean SHELL config.vm.provision "docker" From b262675c91c0bc43492496ef64e283efc76b24ba Mon Sep 17 00:00:00 2001 From: David Manouchehri Date: Thu, 30 Nov 2017 13:18:49 -0500 Subject: [PATCH 3/8] Switch to ${HOME} (https://github.com/linuxkit/linuxkit/pull/2784#pullrequestreview-80242701). Signed-off-by: David Manouchehri --- Vagrantfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 10390d3d8..db7a92b81 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -18,7 +18,7 @@ Vagrant.configure("2") do |config| config.vm.provision "shell", privileged: false, inline: <<-SHELL go get -u github.com/linuxkit/linuxkit/src/cmd/linuxkit - echo "export PATH=${PATH}:/home/`whoami`/go/bin" >> ~/.bashrc + echo "export PATH=${PATH}:${HOME}/go/bin" >> ~/.bashrc SHELL %w(vmware_fusion vmware_workstation vmware_appcatalyst).each do |provider| From 80b54ed34149c89cc0214eaf5eec1ac9b5dc3612 Mon Sep 17 00:00:00 2001 From: David Manouchehri Date: Thu, 30 Nov 2017 14:06:21 -0500 Subject: [PATCH 4/8] Reuse existing local Git repository (https://github.com/linuxkit/linuxkit/pull/2784#pullrequestreview-80121346). Signed-off-by: David Manouchehri --- Vagrantfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index db7a92b81..8352207c3 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -5,8 +5,6 @@ Vagrant.configure("2") do |config| config.vm.box = "bento/ubuntu-16.04" - config.vm.synced_folder ".", "/vagrant", disabled: true - config.vm.provision "shell", inline: <<-SHELL # apt-get update # DEBIAN_FRONTEND=noninteractive apt-get -y upgrade @@ -17,7 +15,11 @@ Vagrant.configure("2") do |config| config.vm.provision "docker" config.vm.provision "shell", privileged: false, inline: <<-SHELL - go get -u github.com/linuxkit/linuxkit/src/cmd/linuxkit + mkdir -p ~/go/src/github.com/linuxkit/ + ln -s /vagrant ~/go/src/github.com/linuxkit/linuxkit + cd ~/go/src/github.com/linuxkit/linuxkit/src/cmd/linuxkit + go get -d + go install echo "export PATH=${PATH}:${HOME}/go/bin" >> ~/.bashrc SHELL From bc437355439170022b83e69c4ef26d92e4cd79e5 Mon Sep 17 00:00:00 2001 From: David Manouchehri Date: Mon, 4 Dec 2017 13:02:00 -0500 Subject: [PATCH 5/8] As requested by @ijc (https://github.com/linuxkit/linuxkit/pull/2784#pullrequestreview-80464126). Signed-off-by: David Manouchehri --- Vagrantfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 8352207c3..5fb063e25 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -6,10 +6,7 @@ Vagrant.configure("2") do |config| config.vm.box = "bento/ubuntu-16.04" config.vm.provision "shell", inline: <<-SHELL - # apt-get update - # DEBIAN_FRONTEND=noninteractive apt-get -y upgrade snap install --classic go - # apt-get clean SHELL config.vm.provision "docker" From e9bc7353e6fa9698a81bd3ec91289c887615685c Mon Sep 17 00:00:00 2001 From: David Manouchehri Date: Mon, 4 Dec 2017 13:54:10 -0500 Subject: [PATCH 6/8] As requested by @justincormack (https://github.com/linuxkit/linuxkit/pull/2784#issuecomment-349064467). Signed-off-by: David Manouchehri --- Vagrantfile => scripts/Vagrantfile | 3 +++ 1 file changed, 3 insertions(+) rename Vagrantfile => scripts/Vagrantfile (89%) diff --git a/Vagrantfile b/scripts/Vagrantfile similarity index 89% rename from Vagrantfile rename to scripts/Vagrantfile index 5fb063e25..44338480f 100644 --- a/Vagrantfile +++ b/scripts/Vagrantfile @@ -5,6 +5,9 @@ Vagrant.configure("2") do |config| config.vm.box = "bento/ubuntu-16.04" + config.vm.synced_folder ".", "/vagrant", disabled: true + config.vm.synced_folder "../", "/vagrant" + config.vm.provision "shell", inline: <<-SHELL snap install --classic go SHELL From c693e50f82bd95c5254a9ebf7b31680e2d7bd179 Mon Sep 17 00:00:00 2001 From: David Manouchehri Date: Tue, 5 Dec 2017 19:08:43 -0500 Subject: [PATCH 7/8] As requested by @ijc (https://github.com/linuxkit/linuxkit/pull/2784#discussion_r154895971). Signed-off-by: David Manouchehri --- scripts/Vagrantfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/Vagrantfile b/scripts/Vagrantfile index 44338480f..56f836b12 100644 --- a/scripts/Vagrantfile +++ b/scripts/Vagrantfile @@ -13,14 +13,14 @@ Vagrant.configure("2") do |config| SHELL config.vm.provision "docker" + config.vm.provision "shell", inline: "ps aux | grep 'sshd:' | awk '{print $2}' | xargs kill" config.vm.provision "shell", privileged: false, inline: <<-SHELL mkdir -p ~/go/src/github.com/linuxkit/ ln -s /vagrant ~/go/src/github.com/linuxkit/linuxkit - cd ~/go/src/github.com/linuxkit/linuxkit/src/cmd/linuxkit - go get -d - go install - echo "export PATH=${PATH}:${HOME}/go/bin" >> ~/.bashrc + cd ~/go/src/github.com/linuxkit/linuxkit + make all + sudo make install SHELL %w(vmware_fusion vmware_workstation vmware_appcatalyst).each do |provider| From 50ac887fb996b5fe0c8382228857b2fa9b673f8a Mon Sep 17 00:00:00 2001 From: David Manouchehri Date: Tue, 12 Dec 2017 20:12:28 -0500 Subject: [PATCH 8/8] As requested.. Again. Signed-off-by: David Manouchehri --- scripts/Vagrantfile | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/Vagrantfile b/scripts/Vagrantfile index 56f836b12..7125a5c8b 100644 --- a/scripts/Vagrantfile +++ b/scripts/Vagrantfile @@ -1,6 +1,5 @@ # -*- mode: ruby -*- # vi: set ft=ruby : -# Author: David Manouchehri Vagrant.configure("2") do |config| config.vm.box = "bento/ubuntu-16.04"