diff --git a/README.md b/README.md index b7059a8..3b3b5a5 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,6 @@ -# RancherOS +# RancherOS Box -Due to not being able to install VBox Extensions, this box may require setting the following in your Vagrantfile - The base Vagrantfile should already do this for you by default. - -``` -# Disable synced folder due to not being able to install VBox Extensions -config.vm.synced_folder ".", "/vagrant", disabled: true -# For now, until I can get a 'vagrant user' working -config.ssh.username = "rancher" -``` +Seeks to keep up to date with RancherOS releases. The default SSH Key has been set up for `vagrant ssh` to allow hacking via the the shell script provisioner. diff --git a/Vagrantfile b/Vagrantfile index 763004b..7d2747d 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -46,13 +46,15 @@ Vagrant.configure("2") do |config| # backing providers for Vagrant. These expose provider-specific options. # Example for VirtualBox: # - # config.vm.provider "virtualbox" do |vb| - # # Display the VirtualBox GUI when booting the machine - # vb.gui = true - # - # # Customize the amount of memory on the VM: - # vb.memory = "1024" - # end + config.vm.provider "virtualbox" do |vb| + vb.check_guest_additions = false + # If the host has a functional vboxsf filesystem + vb.functional_vboxsf = false + # Display the VirtualBox GUI when booting the machine + # vb.gui = true + # Customize the amount of memory on the VM: + vb.memory = "1024" + end # # View the documentation for the provider you are using for more # information on available options. @@ -75,4 +77,9 @@ Vagrant.configure("2") do |config| # SSH Configuration config.ssh.username = "rancher" config.ssh.keys_only = true + + # Stop vagrant-vbguest installing Guest Additions + if Vagrant.has_plugin?("vagrant-vbguest") + config.vbguest.no_install = true + end end diff --git a/build.alpha.bat b/build.alpha.bat new file mode 100644 index 0000000..3419776 --- /dev/null +++ b/build.alpha.bat @@ -0,0 +1,5 @@ +@ECHO OFF +SET ISO_MD5_CHECKSUM=0c13ace5c4b2d18aca1337c2bddde568 +SET VM_DESCRIPTION=A simplified Linux distribution built from containers, for containers +SET VM_VERSION=1.0.1 +packer build -var "vm_description=%VM_DESCRIPTION%" -var "vm_version=%VM_VERSION%" -var "iso_md5_checksum=%ISO_MD5_CHECKSUM%" "packer_rancheros.alpha.json" diff --git a/build.bat b/build.bat index 060fdb3..84cb363 100644 --- a/build.bat +++ b/build.bat @@ -1,5 +1,5 @@ @ECHO OFF -SET ISO_MD5_CHECKSUM=b0e3e198a12a2ae8efe89f5167655879 +SET ISO_MD5_CHECKSUM=0c13ace5c4b2d18aca1337c2bddde568 SET VM_DESCRIPTION=A simplified Linux distribution built from containers, for containers -SET VM_VERSION=1.0.0 +SET VM_VERSION=1.0.1 packer build -force -var "vm_description=%VM_DESCRIPTION%" -var "vm_version=%VM_VERSION%" -var "iso_md5_checksum=%ISO_MD5_CHECKSUM%" "packer_rancheros.json" diff --git a/conf/rancheros-meta.yml b/conf/rancheros-meta.yml index badccc3..7939130 100644 --- a/conf/rancheros-meta.yml +++ b/conf/rancheros-meta.yml @@ -1,3 +1,8 @@ +- 1.0.1: + url: https://releases.rancher.com/os/v1.0.1/rancheros.iso + checksums: + md5: 0c13ace5c4b2d18aca1337c2bddde568 + sha256: 980ce147fbdd9bc4669c042347014ff1068d52fe4c258f3a3e660b1c5080277e - 1.0.0: url: https://releases.rancher.com/os/v1.0.0/rancheros.iso checksums: diff --git a/packer_rancheros.alpha.json b/packer_rancheros.alpha.json new file mode 100644 index 0000000..722250c --- /dev/null +++ b/packer_rancheros.alpha.json @@ -0,0 +1,82 @@ +{ + "variables": { + "iso_md5_checksum": "0c13ace5c4b2d18aca1337c2bddde568", + "version_prerelease_suffix": ".alpha1", + "vm_description": "A simplified Linux distribution built from containers, for containers", + "vm_version": "1.0.1" + }, + "builders": [ + { + "type": "virtualbox-iso", + "guest_os_type": "Linux26_64", + "iso_url": "https://releases.rancher.com/os/v{{ user `vm_version` }}/rancheros.iso", + "iso_checksum": "{{user `iso_md5_checksum` }}", + "iso_checksum_type": "md5", + "guest_additions_mode": "disable", + "ssh_private_key_file": "./keys/vagrant", + "ssh_username": "rancher", + "ssh_wait_timeout": "360s", + "hard_drive_interface": "sata", + "hard_drive_nonrotational": true, + "iso_interface": "sata", + "vm_name": "rancherOS", + "disk_size": "24000", + "boot_wait": "30s", + "boot_command": [ + "echo \"#cloud-config\" >> cloud-config.yml", + "echo \"ssh_authorized_keys:\" >> cloud-config.yml", + "echo \" - ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key\" >> cloud-config.yml", + "sudo ros install -c cloud-config.yml -d /dev/sda", + "y", + "", + "y", + "" + ], + "shutdown_command": "sudo shutdown -h now", + "export_opts": [ + "--manifest", + "--vsys", "0", + "--description", "{{user `vm_description`}}", + "--version", "{{user `vm_version`}}{{user `version_prerelease_suffix` }}" + ], + "vboxmanage": [ + [ + "modifyvm", + "{{.Name}}", + "--memory", + "1024" + ], + [ + "modifyvm", + "{{.Name}}", + "--cpus", + "1" + ] + ] + } + ], + "post-processors": [ + [ + { + "type": "vagrant", + "compression_level": 9, + "keep_input_artifact": false, + "output":"RancherOS_{{user `vm_version`}}.box", + "vagrantfile_template": "./Vagrantfile" + }, + { + "type": "atlas", + "only": ["virtualbox-iso"], + "artifact": "MatthewHartstonge/RancherOS", + "artifact_type": "vagrant.box", + "metadata": { + "provider": "virtualbox", + "version": "{{user `vm_version`}}{{user `version_prerelease_suffix`}}" + } + } + ] + ], + "push": { + "name": "MatthewHartstonge/RancherOS" + } +} diff --git a/packer_rancheros.json b/packer_rancheros.json index 937b906..7c2cf7a 100644 --- a/packer_rancheros.json +++ b/packer_rancheros.json @@ -1,9 +1,9 @@ { "variables": { - "iso_md5_checksum": "b0e3e198a12a2ae8efe89f5167655879", + "iso_md5_checksum": "0c13ace5c4b2d18aca1337c2bddde568", "version_prerelease_suffix": "", "vm_description": "A simplified Linux distribution built from containers, for containers", - "vm_version": "1.0.0" + "vm_version": "1.0.1" }, "builders": [ {