https://github.com/ailispaw/rancheros-iso-box
Vagrant Box with RancherOS ISO
https://github.com/ailispaw/rancheros-iso-box
Last synced: over 1 year ago
JSON representation
Vagrant Box with RancherOS ISO
- Host: GitHub
- URL: https://github.com/ailispaw/rancheros-iso-box
- Owner: ailispaw
- Created: 2015-02-25T19:11:55.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2015-07-03T20:27:22.000Z (about 11 years ago)
- Last Synced: 2023-02-27T14:37:23.721Z (over 3 years ago)
- Language: Ruby
- Homepage:
- Size: 215 KB
- Stars: 8
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Vagrant Box with RancherOS ISO
Packaging a Vagrant box for [RancherOS](https://github.com/rancherio/os) with the original [RancherOS ISO](https://github.com/rancherio/os/releases)
## Packaging
### Requirements
- [VirtualBox](https://www.virtualbox.org/)
- [Packer](https://packer.io/)
- [RancherOS ISO](https://github.com/rancherio/os/releases)
### Build a box
```
$ git clone https://github.com/ailispaw/rancheros-iso-box.git
$ cd rancheros-iso-box
$ packer build template.json
```
Or
```
$ git clone https://github.com/ailispaw/rancheros-iso-box.git
$ cd rancheros-iso-box
$ make
```
## Testing
### Requirements
- [VirtualBox](https://www.virtualbox.org/)
- [Vagrant](https://www.vagrantup.com/)
### Test a box
```
$ vagrant box add -f rancheros rancheros-virtualbox.box
$ vagrant up
$ export DOCKER_HOST=tcp://localhost:2375
$ docker version
```
Or
```
$ make test
```
## Sample Vagrantfile
```ruby
module VagrantPlugins
module GuestLinux
class Plugin < Vagrant.plugin("2")
guest_capability("linux", "change_host_name") do
Cap::ChangeHostName
end
guest_capability("linux", "configure_networks") do
Cap::ConfigureNetworks
end
end
end
end
Vagrant.configure(2) do |config|
config.vm.define "rancheros"
config.vm.box = "ailispaw/rancheros"
config.vm.hostname = "rancheros"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.synced_folder ".", "/vagrant", type: "nfs", mount_options: ["nolock", "vers=3", "udp"]
if Vagrant.has_plugin?("vagrant-triggers") then
config.trigger.after [:up, :resume] do
info "Adjusting datetime after suspend and resume."
run_remote <<-EOT.prepend("\n")
sudo system-docker stop ntp
sudo ntpd -n -q -g -I eth0 > /dev/null
date
sudo system-docker start ntp
EOT
end
end
# Adjusting datetime before provisioning.
config.vm.provision :shell, run: "always" do |sh|
sh.inline = <<-EOT
system-docker stop ntp
ntpd -n -q -g -I eth0 > /dev/null
date
system-docker start ntp
EOT
end
end
```