Skip to content

Commit bcfe40a

Browse files
committed
Add script to install a debian base.
Also install nginx + passenger
1 parent 68cfd00 commit bcfe40a

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

bootstrap-debian-sid.sh

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#!/bin/sh -x
2+
3+
# Script extracted from here: https://wiki.debian.org/Debootstrap
4+
#
5+
6+
export JAIL_NAME=debian-sid-passenger
7+
export BASE_PATH=/home/gramos/jaulas
8+
export MY_CHROOT=$BASE_PATH/$JAIL_NAME
9+
10+
cd $BASE_PATH
11+
mkdir $JAIL_NAME
12+
13+
echo "==> Starting preparing a fresh debian Jessie in ${MY_CHROOT}..."
14+
15+
debootstrap --arch i386 sid $MY_CHROOT http://http.debian.net/debian/
16+
17+
echo "proc $MY_CHROOT/proc proc defaults 0 0" >> /etc/fstab
18+
mount proc $MY_CHROOT/proc -t proc
19+
echo "sysfs $MY_CHROOT/sys sysfs defaults 0 0" >> /etc/fstab
20+
mount sysfs $MY_CHROOT/sys -t sysfs
21+
cp /etc/hosts $MY_CHROOT/etc/hosts
22+
cp /proc/mounts $MY_CHROOT/etc/mtab
23+
24+
#chroot $MY_CHROOT /bin/bash
25+
26+
# --------------------------------------------------------------------------------
27+
28+
echo '==> Installing required basic packages...'
29+
30+
chroot $MY_CHROOT apt-get install -y less vim curl gnupg build-essential ruby ruby-dev \
31+
zlib1g-dev libsqlite3-dev sqlite3 nodejs
32+
33+
##
34+
# We are going to use Rails so we need nodejs
35+
36+
chroot $MY_CHROOT ln -sf /usr/bin/nodejs /usr/local/bin/node
37+
38+
chroot $MY_CHROOT gem install bundler
39+
40+
# --------------------------------------------------------------------------------
41+
42+
echo '==> Installing passenger and nginx...'
43+
44+
chroot $MY_CHROOT apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7
45+
chroot $MY_CHROOT apt-get install -y apt-transport-https ca-certificates
46+
47+
chroot $MY_CHROOT sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger jessie main > /etc/apt/sources.list.d/passenger.list'
48+
hroot $MY_CHROOT apt-get update
49+
50+
chroot $MY_CHROOT apt-get install -y nginx-extras passenger
51+
52+
# --------------------------------------------------------------------------------
53+
54+
echo "8:23:respawn:/usr/sbin/chroot $MY_CHROOT " \
55+
"/sbin/getty 38400 tty8" >> /etc/inittab

0 commit comments

Comments
 (0)