2017-09-07 18:49:22 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
export DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
# Update and ensure we have apt-add-repository
|
|
|
|
apt-get update
|
|
|
|
apt-get install -y software-properties-common
|
|
|
|
|
|
|
|
# Add i386 architecture (for libraries)
|
|
|
|
dpkg --add-architecture i386
|
|
|
|
|
|
|
|
# Update with i386, Go and Docker
|
|
|
|
apt-get update
|
|
|
|
|
|
|
|
# Install Core build utilities for Linux
|
|
|
|
apt-get install -y \
|
|
|
|
build-essential \
|
|
|
|
git \
|
|
|
|
libc6-dev-i386 \
|
|
|
|
libpcre3-dev \
|
|
|
|
linux-libc-dev:i386 \
|
|
|
|
pkg-config \
|
2019-09-06 18:55:16 +00:00
|
|
|
zip \
|
2017-09-07 18:49:22 +00:00
|
|
|
curl \
|
|
|
|
jq \
|
|
|
|
tree \
|
|
|
|
unzip \
|
2019-09-06 18:55:16 +00:00
|
|
|
wget
|
2017-09-07 18:49:22 +00:00
|
|
|
|
|
|
|
# Install ARM build utilities
|
|
|
|
apt-get install -y \
|
|
|
|
binutils-aarch64-linux-gnu \
|
|
|
|
binutils-arm-linux-gnueabihf \
|
2021-04-02 20:29:57 +00:00
|
|
|
gcc-aarch64-linux-gnu \
|
|
|
|
gcc-arm-linux-gnueabihf \
|
|
|
|
gcc-multilib-arm-linux-gnueabihf
|
2017-09-07 18:49:22 +00:00
|
|
|
|
|
|
|
# Install Windows build utilities
|
|
|
|
apt-get install -y \
|
|
|
|
binutils-mingw-w64 \
|
|
|
|
gcc-mingw-w64
|
|
|
|
|
|
|
|
# Ensure everything is up to date
|
|
|
|
apt-get upgrade -y
|
|
|
|
|
|
|
|
# Set hostname -> IP to make advertisement work as expected
|
|
|
|
ip=$(ip route get 1 | awk '{print $NF; exit}')
|
|
|
|
hostname=$(hostname)
|
|
|
|
sed -i -e "s/.*nomad.*/${ip} ${hostname}/" /etc/hosts
|
|
|
|
|
|
|
|
# Ensure we cd into the working directory on login
|
|
|
|
if ! grep "cd /opt/gopath/src/github.com/hashicorp/nomad" /home/vagrant/.profile ; then
|
|
|
|
echo 'cd /opt/gopath/src/github.com/hashicorp/nomad' >> /home/vagrant/.profile
|
|
|
|
fi
|