forked from canonical/serial-vault
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup-container
executable file
·36 lines (26 loc) · 922 Bytes
/
setup-container
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
set -e
# Barf if not uid 0
if [ $(id -u) -ne "0" ]; then
echo "Please run me with sudo"
exit
fi
if ! grep -qa container=lxc /proc/1/environ; then
echo "You're not in an LXC container, so I'm refusing to run."
exit
fi
# Disable debconf questions.
export DEBIAN_FRONTEND=noninteractive
# If your host system is not in English, need to fix the locale for
# the lxc, as the project (and its tests) assume an English machine.
sed -i 's/LANG=.*/LC_ALL="en_US.UTF-8"/' /etc/default/locale
snap install go --channel 1.13 --classic
# Let's make sure your system is up to date
apt-get update
apt-get upgrade -y --allow-downgrades --allow-remove-essential --allow-change-held-packages
apt-get autoremove -y
# Install project's OS dependencies.
cat dependencies.txt dependencies-devel.txt | xargs apt install --no-install-recommends -y
# we are done
echo All done, now you can do
echo make bootstrap