Skip to content

Instantly share code, notes, and snippets.

@mikeananev
Created February 3, 2019 11:20
Show Gist options
  • Save mikeananev/33b6d0cb101a16248e43ded0fc6ca168 to your computer and use it in GitHub Desktop.
Save mikeananev/33b6d0cb101a16248e43ded0fc6ca168 to your computer and use it in GitHub Desktop.
Basic Centos 7 image with JDK11, Clojure 1.10
# -*- mode: ruby -*-
# vi: set ft=ruby :
# ********************************************************
# on Mac run:
# vagrant plugin install vagrant-vbguest
# ********************************************************
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
config.vm.hostname = "appsrv01"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# NOTE: This will enable public access to the opened port
config.vm.network "forwarded_port", guest: 8080, host: 8080
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine and only allow access
# via 127.0.0.1 to disable public access
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network "public_network"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
# config.vm.synced_folder "host-data", "/vagrant_data", type: "nfs"
config.vm.synced_folder "host-data", "/vagrant_data"
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 = "2048"
vb.cpus = "2"
end
# Enable provisioning with a shell script. Additional provisioners such as
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
# documentation for more information about their specific syntax and use.
config.vm.provision "shell", inline: <<-SHELL
localedef -i ru_RU -f UTF-8 ru_RU.UTF-8
localectl set-locale LANG=ru_RU.UTF-8
yum install unzip -y
yum install mc -y
yum install gcc make cmake -y
yum install java-11-openjdk.x86_64 -y
curl -O https://download.clojure.org/install/linux-install-1.10.0.411.sh
chmod +x linux-install-1.10.0.411.sh
sudo ./linux-install-1.10.0.411.sh
yum install epel-release -y
yum install rlwrap -y
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment