-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·28 lines (19 loc) · 973 Bytes
/
setup.sh
File metadata and controls
executable file
·28 lines (19 loc) · 973 Bytes
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
#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo "This script must be run with root permissions"
exit
fi
USER=$(who am i | awk '{print $1}')
apt-get update
apt-get install -y apt-transport-https ca-certificates curl software-properties-common inotify-tools
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update
apt-get install docker-ce
usermod -aG docker ${USER}
docker build --build-arg UID=$(id ${USER} -u) --build-arg GID=$(id ${USER} -g) -t 'compiler_machine' - < Dockerfile
ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
chmod +x ${ROOT}/lib/runner.sh ${ROOT}/store/default/run.sh
mkdir -p ${ROOT}/store/code
echo "Docker setup successfully. To use docker without sudo you have to log out and log back in!"
echo "You can then install Ruby and required gems, and you can execute rackup to start the server."