-
Notifications
You must be signed in to change notification settings - Fork 1
/
bootstrap.sh
executable file
·46 lines (28 loc) · 1.28 KB
/
bootstrap.sh
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
36
37
38
39
40
41
42
43
44
45
46
#!/bin/sh -x
# Script extracted from here: https://wiki.debian.org/Debootstrap
#
export JAIL_NAME=debian-jessie-passenger
export BASE_PATH=$(pwd)/tmp/jaulas
export MY_CHROOT=$BASE_PATH/$JAIL_NAME
if [[ ! -e $BASE_PATH/$JAIL_NAME ]]; then
mkdir -p $BASE_PATH/$JAIL_NAME
fi
# --------------------------------------------------------------------------------
echo "==> Install debootstrap..."
apt-get install debootstrap
echo "==> Starting preparing a fresh debian SID in ${MY_CHROOT}..."
debootstrap --arch i386 jessie $MY_CHROOT http://http.debian.net/debian/
cp /etc/hosts $MY_CHROOT/etc/hosts
chroot $MY_CHROOT mount -t proc proc /proc
# --------------------------------------------------------------------------------
echo '==> Installing required basic packages...'
chroot $MY_CHROOT apt-get update
chroot $MY_CHROOT apt-get install -y less curl gnupg build-essential ruby ruby-dev \
zlib1g-dev libsqlite3-dev sqlite3 nodejs vim sudo git
##
# We are going to use Rails so we need nodejs
chroot $MY_CHROOT ln -sf /usr/bin/nodejs /usr/local/bin/node
chroot $MY_CHROOT gem install bundler
# --------------------------------------------------------------------------------
echo "8:23:respawn:/usr/sbin/chroot $MY_CHROOT " \
"/sbin/getty 38400 tty8" >> /etc/inittab