This repository was archived by the owner on Oct 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 183
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
11 changed files
with
165 additions
and
82 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
.DS_Store | ||
packer_cache/ | ||
*.box | ||
boot2docker.iso | ||
boot2docker.vdi | ||
Vagrantfile | ||
.DS_Store | ||
.vagrant/ | ||
packer_cache/ | ||
*.box | ||
b2d.iso | ||
boot2docker-vagrant.iso |
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,19 @@ | ||
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | ||
VAGRANTFILE_API_VERSION = "2" | ||
|
||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | ||
# All Vagrant configuration is done here. The most common configuration | ||
# options are documented and commented below. For a complete reference, | ||
# please see the online documentation at vagrantup.com. | ||
|
||
# Every Vagrant virtual environment requires a box to build off of. | ||
config.vm.box = "precise32" | ||
config.vm.box_url = "http://opscode-vm-bento.s3.amazonaws.com/vagrant/virtualbox/opscode_ubuntu-12.04-i386_chef-provisionerless.box" | ||
|
||
config.vm.provider "virtualbox" do |v| | ||
v.customize ["modifyvm", :id, "--memory", "1500"] | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/bin/bash | ||
# | ||
# This script takes a boot2docker.iso and re-processes it to be usable | ||
# by Vagrant. | ||
# | ||
set -e | ||
set -x | ||
|
||
B2D_URL="https://github.com/steeve/boot2docker/releases/download/v0.5.4/boot2docker.iso" | ||
|
||
apt-get -y update | ||
apt-get install -y genisoimage | ||
|
||
#-------------------------------------------------------------------- | ||
# B2D | ||
#-------------------------------------------------------------------- | ||
# Download boot2docker | ||
wget -O b2d.iso ${B2D_URL} | ||
|
||
# Mount it up | ||
rm -rf /tmp/boot | ||
mkdir -p /mnt/tmp | ||
mount b2d.iso /mnt/tmp -o loop,ro | ||
cp -a /mnt/tmp/boot /tmp | ||
mv /tmp/boot/initrd.img /tmp | ||
umount /mnt/tmp | ||
|
||
# Extract the core filesystem | ||
EXTRACT_DIR="/tmp/extract" | ||
rm -rf ${EXTRACT_DIR} | ||
mkdir -p ${EXTRACT_DIR} | ||
pushd ${EXTRACT_DIR} | ||
lzma -dc /tmp/initrd.img | cpio -i -H newc -d | ||
popd | ||
|
||
#-------------------------------------------------------------------- | ||
# Customization | ||
#-------------------------------------------------------------------- | ||
# Script to add in public key | ||
cat <<EOF > ${EXTRACT_DIR}/etc/rc.d/vagrant | ||
mkdir -p /home/docker/.ssh | ||
chmod 0700 /home/docker/.ssh | ||
cat <<KEY >/home/docker/.ssh/authorized_keys | ||
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key | ||
KEY | ||
chmod 0600 /home/docker/.ssh/authorized_keys | ||
chown -R docker:staff /home/docker/.ssh | ||
EOF | ||
chmod +x ${EXTRACT_DIR}/etc/rc.d/vagrant | ||
|
||
# Configure boot to add public key | ||
echo "/etc/rc.d/vagrant" >> ${EXTRACT_DIR}/opt/bootsync.sh | ||
|
||
#-------------------------------------------------------------------- | ||
# Package | ||
#-------------------------------------------------------------------- | ||
# Make the initrd.img image... | ||
pushd ${EXTRACT_DIR} | ||
find | cpio -o -H newc | xz -9 --format=lzma > /tmp/initrd.img | ||
popd | ||
|
||
# Make the ISO | ||
pushd /tmp | ||
mv initrd.img boot | ||
mkdir newiso | ||
mv boot newiso | ||
popd | ||
mkisofs -l -J -R -V b2d-vagrant -no-emul-boot -boot-load-size 4 \ | ||
-boot-info-table -b boot/isolinux/isolinux.bin \ | ||
-c boot/isolinux/boot.cat -o boot2docker-vagrant.iso /tmp/newiso | ||
rm -rf /tmp/newiso |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
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 |
---|---|---|
@@ -1,44 +1,29 @@ | ||
{ | ||
"builders": [{ | ||
"type": "virtualbox-iso", | ||
"iso_url": "boot2docker.iso", | ||
"iso_checksum": "522fc919ef97ed60c221b1a99a65ff2f", | ||
"iso_checksum_type": "md5", | ||
"iso_url": "boot2docker-vagrant.iso", | ||
"iso_checksum_type": "none", | ||
"boot_wait": "5s", | ||
"ssh_username": "docker", | ||
"ssh_password": "tcuser", | ||
"shutdown_command": "sudo poweroff", | ||
"guest_additions_mode": "disable", | ||
"guest_os_type": "Linux_64", | ||
"vboxmanage": [ | ||
["storagectl", "{{.Name}}", "--name", "SATA", "--add", "sata", | ||
"--hostiocache", "on"], | ||
["storageattach", "{{.Name}}", "--storagectl", "SATA", | ||
"--port", "0", "--device", "0", | ||
"--type", "dvddrive", "--medium", "boot2docker.iso"], | ||
["storageattach", "{{.Name}}", "--storagectl", "SATA", | ||
"--port", "1", "--device", "0", | ||
"--type", "hdd", "--medium", "persistent2.vmdk"] | ||
] | ||
}], | ||
|
||
"provisioners": [{ | ||
"type": "file", | ||
"source": "files/", | ||
"destination": "/tmp" | ||
"ssh_username": "docker", | ||
"ssh_password": "tcuser", | ||
"shutdown_command": "sudo poweroff" | ||
}, { | ||
"type": "shell", | ||
"inline": [ | ||
"sudo cp /tmp/sshd_config /var/lib/boot2docker/ssh/sshd_config", | ||
"sudo cp /tmp/vagrant_key.pub /var/lib/boot2docker/ssh/docker_authorized_keys", | ||
"sudo chown docker:docker /var/lib/boot2docker/ssh/docker_authorized_keys", | ||
"sudo chmod 0600 /var/lib/boot2docker/ssh/docker_authorized_keys" | ||
] | ||
"type": "vmware-iso", | ||
"iso_url": "boot2docker-vagrant.iso", | ||
"iso_checksum_type": "none", | ||
"boot_wait": "5s", | ||
"guest_os_type": "other3xlinux-64", | ||
"ssh_username": "docker", | ||
"ssh_password": "tcuser", | ||
"shutdown_command": "sudo poweroff" | ||
}], | ||
|
||
"post-processors": [{ | ||
"type": "vagrant", | ||
"vagrantfile_template": "vagrantfile_virtualbox.tpl", | ||
"output": "boot2docker.box" | ||
"include": ["boot2docker-vagrant.iso"], | ||
"vagrantfile_template": "vagrantfile.tpl", | ||
"output": "boot2docker_{{.Provider}}.box" | ||
}] | ||
} |
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,31 @@ | ||
Vagrant.configure("2") do |config| | ||
config.ssh.shell = "sh -l" | ||
config.ssh.username = "docker" | ||
|
||
# Disable synced folders because guest additions aren't available | ||
config.vm.synced_folder ".", "/vagrant", disabled: true | ||
|
||
# Expose the Docker port | ||
config.vm.network "forwarded_port", guest: 4243, host: 4243 | ||
|
||
# Attach the ISO | ||
config.vm.provider "virtualbox" do |v| | ||
v.customize "pre-boot", [ | ||
"storageattach", :id, | ||
"--storagectl", "IDE Controller", | ||
"--port", "0", | ||
"--device", "1", | ||
"--type", "dvddrive", | ||
"--medium", File.expand_path("../boot2docker-vagrant.iso", __FILE__), | ||
] | ||
end | ||
|
||
["vmware_fusion", "vmware_workstation"].each do |vmware| | ||
config.vm.provider vmware do |v| | ||
v.vmx["bios.bootOrder"] = "CDROM,hdd" | ||
v.vmx["ide1:0.present"] = "TRUE" | ||
v.vmx["ide1:0.fileName"] = File.expand_path("../boot2docker-vagrant.iso", __FILE__) | ||
v.vmx["ide1:0.deviceType"] = "cdrom-image" | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.