Last active
August 17, 2017 15:03
-
-
Save timakin/9c64bf1b9fa737f6cae04fbe1f952700 to your computer and use it in GitHub Desktop.
vagrantfile for godev
This file contains hidden or 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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# http://www.vagrantbox.es/ | |
# $ vagrant box add ubuntu/trusty64 | |
# $ vagrant init ubuntu/trusty64 | |
# $ vagrant up | |
# $ vagrant ssh-config | |
# $ ssh-keygen -yf /Users/hogeee/go/src/.vagrant/machines/default/virtualbox/private_key > public_key | |
# $ cat public_key | |
# $ vagrant ssh | |
# $ chmod 700 .ssh | |
# $ chmod 600 authorized_keys | |
# $ vi authorized_keys (< public_key) | |
# $ exit | |
# $ vagrant reload | |
# $ su - (password: vagrant) | |
# $ export PATH=$PATH:/usr/local/go/bin | |
# $ export GOPATH=$HOME/go | |
# $ export PATH=$PATH:$GOPATH/bin | |
# $ cd /home/vagrant/godev/src/ && ./all.bash | |
Vagrant.configure('2') do |config| | |
# http://qiita.com/yyuuiikk/items/7b8a2069c11b238da3c3 | |
config.vm.box = 'ubuntu/trusty64' | |
config.ssh.insert_key = false | |
config.vm.network 'private_network', ip: '192.168.33.10' | |
config.vm.synced_folder '/Users/takahashiseiji/go/src/go', '/home/vagrant/godev' | |
config.vm.provision 'shell', inline: <<-SHELL | |
apt-get update | |
apt-get install gcc sudo git wget -y | |
wget https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz --no-check-certificate | |
tar -C /usr/local -xzf go1.8.3.linux-amd64.tar.gz | |
mkdir tmp/ | |
wget https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz --no-check-certificate | |
tar zxvf go1.4.2.linux-amd64.tar.gz -C tmp/ | |
mv tmp/go /home/vagrant/go1.4 | |
# export PATH=$PATH:/usr/local/go/bin | |
# export GOPATH=$HOME/go | |
# export PATH=$PATH:$GOPATH/bin | |
SHELL | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Set memory 2048MB, to defend out of memory errors