This repository was archived by the owner on May 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
203 additions
and
59 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
Vagrant.require_version ">= 1.8.0" | ||
|
||
environment_name = "Docker builder environment" | ||
memsize = 2048 | ||
numvcpus = 2 | ||
|
||
Vagrant.configure("2") do | config | | ||
|
||
# Box | ||
config.vm.box = "skyzyx/centos7" | ||
config.vm.boot_timeout = 120 | ||
|
||
# Check for vbguest plugin | ||
if Vagrant.has_plugin?("vagrant-vbguest") | ||
config.vbguest.auto_update = true | ||
config.vbguest.no_remote = false | ||
end | ||
|
||
# Synced folders | ||
if Vagrant::Util::Platform.windows? | ||
config.vm.synced_folder "", "/vagrant", type: "smb" | ||
else | ||
config.vm.synced_folder "", "/vagrant", type: "nfs" | ||
end | ||
|
||
# Oracle VirtualBox | ||
config.vm.provider :virtualbox do | vb | | ||
vb.name = environment_name | ||
vb.gui = false | ||
|
||
vb.memory = memsize | ||
vb.cpus = numvcpus | ||
vb.customize ["modifyvm", :id, "--ioapic", "on"] | ||
end | ||
|
||
# VMware Fusion | ||
config.vm.provider :vmware_fusion do | vm | | ||
vm.name = environment_name | ||
vm.gui = false | ||
|
||
vm.vmx["memsize"] = memsize | ||
vm.vmx["numvcpus"] = numvcpus | ||
end | ||
|
||
# Parallels Desktop | ||
config.vm.provider :parallels do | prl | | ||
prl.name = environment_name | ||
prl.update_guest_tools = true | ||
|
||
prl.memory = memsize | ||
prl.cpus = numvcpus | ||
end | ||
|
||
config.vm.provision :shell, inline: "yum -y install docker-engine" | ||
end |
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/sh -eux | ||
# https://github.com/chef/bento/blob/master/scripts/common/vmtools.sh | ||
|
||
e() { | ||
echo -e " \e[1;32m[install] ==> $@\e[0m"; | ||
} | ||
|
||
e "Set a default HOME_DIR environment variable if not set" | ||
HOME_DIR="${HOME_DIR:-/home/vagrant}"; | ||
|
||
case "$PACKER_BUILDER_TYPE" in | ||
|
||
virtualbox-iso|virtualbox-ovf) | ||
VER="`cat /home/vagrant/.vbox_version`"; | ||
e "Virtualbox Tools Version: $VER"; | ||
|
||
yum -y install kernel-devel-`uname -r` | ||
|
||
mkdir -p /tmp/vbox; | ||
mount -o loop $HOME_DIR/VBoxGuestAdditions_${VER}.iso /tmp/vbox; | ||
sh /tmp/vbox/VBoxLinuxAdditions.run \ | ||
|| echo "VBoxLinuxAdditions.run exited $? and is suppressed." \ | ||
"For more read https://www.virtualbox.org/ticket/12479"; | ||
umount /tmp/vbox; | ||
rm -rf /tmp/vbox; | ||
rm -f $HOME_DIR/*.iso; | ||
;; | ||
|
||
vmware-iso|vmware-vmx) | ||
e "Use open-vm-tools" | ||
yum -y install open-vm-tools | ||
mkdir -p /mnt/hgfs; | ||
;; | ||
|
||
parallels-iso|parallels-pvm) | ||
mkdir -p /tmp/parallels; | ||
mount -o loop $HOME_DIR/prl-tools-lin.iso /tmp/parallels; | ||
VER="`cat /tmp/parallels/version`"; | ||
|
||
e "Parallels Tools Version: $VER"; | ||
|
||
/tmp/parallels/install --install-unattended-with-deps \ | ||
|| (code="$?"; \ | ||
echo "Parallels tools installation exited $code, attempting" \ | ||
"to output /var/log/parallels-tools-install.log"; \ | ||
cat /var/log/parallels-tools-install.log; \ | ||
exit $code); | ||
umount /tmp/parallels; | ||
rm -rf /tmp/parallels; | ||
rm -f $HOME_DIR/*.iso; | ||
;; | ||
|
||
qemu) | ||
echo "Don't need anything for this one" | ||
;; | ||
|
||
*) | ||
echo "Unknown Packer Builder Type >>$PACKER_BUILDER_TYPE<< selected."; | ||
echo "Known are virtualbox-iso|virtualbox-ovf|vmware-iso|vmware-vmx|parallels-iso|parallels-pvm."; | ||
;; | ||
|
||
esac |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"builders": [ | ||
{ | ||
"type": "docker", | ||
"image": "centos:7.2.1511", | ||
"export_path": "builds/centos7-x64-{{.Provider}}.tar" | ||
} | ||
], | ||
"provisioners": [ | ||
{ | ||
"type": "shell", | ||
"execute_command": "echo 'vagrant' | sudo -S sh '{{.Path}}'", | ||
"override": { | ||
"docker": { | ||
"scripts": [ | ||
"scripts/base.sh", | ||
"scripts/configs.sh", | ||
"scripts/packages.sh", | ||
"scripts/cleanup.sh" | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains 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