Skip to content

Instantly share code, notes, and snippets.

@denisinla
Forked from 0xIslamTaha/install_golang.sh
Last active November 4, 2016 02:17
Show Gist options
  • Save denisinla/94854ed31f359aa4911800aad6161916 to your computer and use it in GitHub Desktop.
Save denisinla/94854ed31f359aa4911800aad6161916 to your computer and use it in GitHub Desktop.
Vagrant + Centos7 + Go
#!/bin/bash
GO_URL="https://storage.googleapis.com/golang"
GO_FILE="go1.7.3.linux-amd64.tar.gz"
yum install -y wget git-core # the -y implies yes when installing in Vagrant.
cd /tmp
wget --no-check-certificate ${GO_URL}/${GO_FILE}
tar -xzf ${GO_FILE}
mv go /usr/local/go
echo 'export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/dev
export PATH=$PATH:$GOPATH/bin' >> /etc/profile
source /etc/profile
go version
Vagrant.configure(2) do |config|
config.vm.box = "centos/7"
config.vm.network "private_network", ip: "192.168.55.20"
config.vm.synced_folder ".", "/home/vagrant/dev", nfs: true
config.vm.provider "virtualbox" do |v|
v.name = "golangvbox"
end
config.vm.provision "shell", path: "provision.sh", privileged: true, binary: false
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment