forked from dry-dock/u16phpall
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·90 lines (75 loc) · 2.86 KB
/
install.sh
File metadata and controls
executable file
·90 lines (75 loc) · 2.86 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash
apt-get clean
mv /var/lib/apt/lists/* /tmp
mkdir -p /var/lib/apt/lists/partial
apt-get clean
# Install dependencies
echo "=========== Installing dependencies ============"
apt-get purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`
add-apt-repository -y ppa:ondrej/php
apt-get update
apt-get install php5.6
apt-get install php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml
apt-get install -y git wget cmake libmcrypt-dev libreadline-dev libzmq-dev
apt-get install -y libxml2-dev \
libjpeg-dev \
libpng-dev \
libtidy-dev \
libxml2-dev \
libpcre3-dev \
libbz2-dev \
libcurl4-openssl-dev \
libminiupnpc-dev\
libdb5.3-dev \
libpng12-dev \
libxpm-dev \
libfreetype6-dev \
libgd2-xpm-dev \
libgmp-dev \
libsasl2-dev \
libmhash-dev \
unixodbc-dev \
freetds-dev \
libpspell-dev \
libsnmp-dev \
libxslt1-dev \
libmcrypt-dev
#libt1-dev \
apt-get install -y php5.6-dev
#fixes for ubuntu 16.04. create soft links
ln -s /usr/include/tidy/tidybuffio.h /usr/include/tidy/buffio.h
ln -s /usr/include/tidy/tidyplatform.h /usr/include/tidy/platform.h
#install gosu
echo "================= Installing GoSu ==================="
/u16phpall/install_gosu.sh
#create a separate user for running php compose wihtout root
#needs gosu installed in the u16all base image
useradd phpuser
echo 'phpuser ALL=(ALL:ALL) ALL' >> /etc/sudoers
echo 'phpuser ALL=(ALL) NOPASSWD: /home/phpuser/php-build/install.sh' >> /etc/sudoers
chown -R phpuser /u16phpall/version
chown phpuser /u16phpall/_install.sh
mkdir /home/phpuser
chown -R phpuser /home/phpuser
#add php user to sudo group
usermod -aG sudo phpuser
# Edit sudoers file # To avoid error: sudo: sorry, you must have a tty to run sudo
sed -i -e "s/Defaults requiretty.*/ #Defaults requiretty/g" /etc/sudoers
# Install php-build
echo "============ Installing php-build =============="
git clone git://github.com/php-build/php-build.git $HOME/php-build
sudo $HOME/php-build/install.sh
rm -rf $HOME/php-build
#Download pickle
git clone https://github.com/FriendsOfPHP/pickle.git /tmp/pickle
sudo ln -s /tmp/pickle/bin/pickle /usr/bin/
#let phpuser own the pickle
chown -R phpuser /tmp/pickle
#run remaining scripts by droppping root privileges as a phpuser
echo "================= Installing phpversions as phpuser ==================="
gosu phpuser /u16phpall/_install.sh
# Cleaning package lists
echo "================= Cleaning package lists ==================="
apt-get clean
apt-get autoclean
apt-get autoremove