forked from deminy/docker-php-5.2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
323 lines (313 loc) · 11.9 KB
/
Dockerfile
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
FROM ubuntu:12.04
# Install apache
RUN apt-get update && \
RUNLEVEL=1 apt-get install -y --no-install-recommends \
apache2 apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common \
libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap \
libasn1-8-heimdal libcap2 libclass-isa-perl libexpat1 libgcrypt11 libgdbm3 \
libgnutls26 libgpg-error0 libgssapi3-heimdal libhcrypto4-heimdal \
libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal \
libkrb5-26-heimdal libldap-2.4-2 libp11-kit0 libroken18-heimdal libsasl2-2 \
libsqlite3-0 libswitch-perl libtasn1-3 libwind0-heimdal mime-support perl \
perl-modules \
&& \
apt-get clean && \
rm -Rf /var/lib/apt/lists/* && \
rm -Rf /var/cache/* && \
a2enmod rewrite && \
rm /etc/apache2/sites-enabled/000-default && \
# To support file written on mounted volumes
usermod -u 1000 -s /bin/false www-data && groupmod -g 1000 www-data && \
# To resolve issue "Could not reliably determine the server's fully qualified domain name..."
echo "ServerName localhost" >> /etc/apache2/ports.conf
COPY 000-project.conf /etc/apache2/sites-enabled/
# Download an build PHP 5.2.17
# See https://askubuntu.com/questions/597462/how-to-install-php-5-2-x-on-ubuntu-14-04
RUN mkdir /php && \
cd /php && \
apt-get update && \
apt-get install -y --no-install-recommends \
apache2-prefork-dev autoconf binutils build-essential bzip2 ca-certificates \
comerr-dev cpp cpp-4.6 dpkg-dev g++ g++-4.6 gcc gcc-4.6 krb5-multidev \
libapr1-dev libaprutil1-dev libaspell-dev libaspell15 libbz2-dev \
libc-client2007e libc-client2007e-dev libc-dev-bin libc6-dev libcurl3 \
libcurl4-openssl-dev libdpkg-perl libexpat1-dev libfreetype6 \
libfreetype6-dev libgcrypt11-dev libgdbm-dev libgmp10 libgnutls-dev \
libgnutls-openssl27 libgnutlsxx27 libgomp1 libgpg-error-dev \
libgssapi-krb5-2 libgssrpc4 libice-dev libice6 libidn11 libidn11-dev \
libjpeg-dev libjpeg-turbo8 libjpeg-turbo8-dev libjpeg8 libjpeg8-dev \
libk5crypto3 libkadm5clnt-mit8 libkadm5srv-mit8 libkdb5-6 libkeyutils1 \
libkrb5-3 libkrb5-dev libkrb5support0 libldap2-dev libltdl-dev libltdl7 \
libmagic-dev libmagic1 libmcrypt-dev libmcrypt4 libmhash-dev libmhash2 \
libmpc2 libmpfr4 libmysqlclient-dev libmysqlclient18 libncurses5-dev \
libp11-kit-dev libpam0g-dev libpcre3-dev libpcrecpp0 libpng12-dev libpopt0 \
libpq-dev libpq5 libpspell-dev libpthread-stubs0 libpthread-stubs0-dev \
libquadmath0 libreadline-dev libreadline6-dev librtmp-dev librtmp0 \
libsm-dev libsm6 libsqlite3-dev libssl-dev libstdc++6-4.6-dev libt1-5 \
libt1-dev libtasn1-3-dev libtimedate-perl libtinfo-dev libx11-6 libx11-data \
libx11-dev libxau-dev libxau6 libxaw7 libxaw7-dev libxcb1 libxcb1-dev \
libxdmcp-dev libxdmcp6 libxext-dev libxext6 libxml2 libxml2-dev libxmu-dev \
libxmu-headers libxmu6 libxpm-dev libxpm4 libxt-dev libxt6 linux-libc-dev \
m4 make mlock mysql-common openssl patch pkg-config uuid-dev wget \
x11-common x11proto-core-dev x11proto-input-dev x11proto-kb-dev \
x11proto-xext-dev xorg-sgml-doctools xtrans-dev zlib1g-dev \
&& \
wget http://museum.php.net/php5/php-5.2.17.tar.bz2 && \
tar xfj php-5.2.17.tar.bz2 && \
ln -s /usr/lib/x86_64-linux-gnu/libjpeg.* /usr/lib/ && \
ln -s /usr/lib/x86_64-linux-gnu/libpng.* /usr/lib/ && \
ln -s /usr/lib/x86_64-linux-gnu/libkrb5.* /usr/lib/ && \
ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.* /usr/lib/ && \
cd php-5.2.17; \
wget -c -t 3 -O ./debian_patches_disable_SSLv2_for_openssl_1_0_0.patch https://bugs.php.net/patch-display.php\?bug_id\=54736\&patch\=debian_patches_disable_SSLv2_for_openssl_1_0_0.patch\&revision=1305414559\&download\=1 && \
patch -p1 -b < debian_patches_disable_SSLv2_for_openssl_1_0_0.patch && \
# Build apache module
./configure \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--prefix=/usr \
--build=i686-pc-linux-gnu \
--host=i686-pc-linux-gnu \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--datadir=/usr/share \
--sysconfdir=/etc \
--localstatedir=/var/lib \
--prefix=/usr/lib/php5.2 \
--mandir=/usr/lib/php5.2/man \
--infodir=/usr/lib/php5.2/info \
--libdir=/usr/lib/php5.2/lib \
--with-libdir=lib \
--with-pear \
--disable-maintainer-zts \
--enable-bcmath \
--with-bz2 \
--enable-calendar \
--with-curl \
--with-curlwrappers \
--disable-dbase \
--enable-exif \
--without-fbsql \
--without-fdftk \
--enable-ftp \
--with-gettext \
--without-gmp \
--disable-ipv6 \
--with-kerberos \
--enable-mbstring \
--with-mcrypt \
--with-mhash \
--without-msql \
--without-mssql \
--with-ncurses \
--with-openssl \
--with-openssl-dir=/usr \
--disable-pcntl \
--without-pgsql \
--with-pspell \
--without-recode \
--disable-shmop \
--without-snmp \
--enable-soap \
--enable-sockets \
--without-sybase-ct \
--disable-sysvmsg \
--disable-sysvsem \
--disable-sysvshm \
--without-tidy \
--disable-wddx \
--disable-xmlreader \
--disable-xmlwriter \
--with-xmlrpc \
--without-xsl \
--enable-zip \
--with-zlib \
--disable-debug \
--enable-dba \
--without-cdb \
--disable-flatfile \
--with-gdbm \
--disable-inifile \
--without-qdbm \
--with-freetype-dir=/usr \
--with-t1lib=/usr \
--disable-gd-jis-conv \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--without-xpm-dir \
--with-gd \
--with-imap \
--with-imap-ssl \
--without-interbase \
--with-mysql=/usr \
--with-mysqli=/usr/bin/mysql_config \
--without-oci8 \
--without-pdo-dblib \
--with-pdo-mysql=/usr \
--without-pdo-pgsql \
--without-pdo-sqlite \
--without-pdo-odbc \
--with-readline \
--without-libedit \
--without-mm \
--without-sqlite \
--with-pcre-regex \
--with-config-file-path=/etc/php/apache2-php5.2 \
--with-config-file-scan-dir=/etc/php/apache2-php5.2/ext-active \
--disable-cli \
--disable-cgi \
--disable-embed \
--with-apxs2=/usr/bin/apxs2 \
--with-pic \
&& \
make && \
make install && \
# Build cli
./configure \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--prefix=/usr \
--build=i686-pc-linux-gnu \
--host=i686-pc-linux-gnu \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--datadir=/usr/share \
--sysconfdir=/etc \
--localstatedir=/var/lib \
--prefix=/usr/lib/php5.2 \
--mandir=/usr/lib/php5.2/man \
--infodir=/usr/lib/php5.2/info \
--libdir=/usr/lib/php5.2/lib \
--with-libdir=lib \
--with-pear \
--disable-maintainer-zts \
--enable-bcmath \
--with-bz2 \
--enable-calendar \
--with-curl \
--with-curlwrappers \
--disable-dbase \
--enable-exif \
--without-fbsql \
--without-fdftk \
--enable-ftp \
--with-gettext \
--without-gmp \
--disable-ipv6 \
--with-kerberos \
--enable-mbstring \
--with-mcrypt \
--with-mhash \
--without-msql \
--without-mssql \
--with-ncurses \
--with-openssl \
--with-openssl-dir=/usr \
--disable-pcntl \
--without-pgsql \
--with-pspell \
--without-recode \
--disable-shmop \
--without-snmp \
--enable-soap \
--enable-sockets \
--without-sybase-ct \
--disable-sysvmsg \
--disable-sysvsem \
--disable-sysvshm \
--without-tidy \
--disable-wddx \
--disable-xmlreader \
--disable-xmlwriter \
--with-xmlrpc \
--without-xsl \
--enable-zip \
--with-zlib \
--disable-debug \
--enable-dba \
--without-cdb \
--disable-flatfile \
--with-gdbm \
--disable-inifile \
--without-qdbm \
--with-freetype-dir=/usr \
--with-t1lib=/usr \
--disable-gd-jis-conv \
--with-jpeg-dir=/usr \
--with-png-dir=/usr \
--without-xpm-dir \
--with-gd \
--with-imap \
--with-imap-ssl \
--without-interbase \
--with-mysql=/usr \
--with-mysqli=/usr/bin/mysql_config \
--without-oci8 \
--without-pdo-dblib \
--with-pdo-mysql=/usr \
--without-pdo-pgsql \
--without-pdo-sqlite \
--without-pdo-odbc \
--with-readline \
--without-libedit \
--without-mm \
--without-sqlite \
--with-pcre-regex \
--with-config-file-path=/etc/php/cli-php5.2 \
--with-config-file-scan-dir=/etc/php/cli-php5.2/ext-active \
--enable-cli \
--disable-cgi \
--disable-embed \
--with-pic \
&& \
make clean && \
make && \
make install && \
# Add extensions
pecl install Fileinfo && \
pecl install memcache && \
cd /php && \
wget http://downloads.zend.com/optimizer/3.3.3/ZendOptimizer-3.3.3-linux-glibc23-x86_64.tar.gz && \
tar xzf ZendOptimizer-3.3.3-linux-glibc23-x86_64.tar.gz && \
mkdir /usr/lib/php5.2/modules && \
cp ZendOptimizer-3.3.3-linux-glibc23-x86_64/data/5_2_x_comp/ZendOptimizer.so /usr/lib/php5.2/modules/ && \
cd /php && \
wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz && \
tar -xvf ioncube_loaders_lin_x86* && \
cp ioncube/ioncube_loader_lin_5.2.so /usr/lib/php5.2/lib/extensions/no-debug-non-zts-20060613/ && \
# Clean up
rm -Rf /php && \
rm -Rf /var/cache/* && \
rm -Rf /tmp/pear && \
apt-get purge -y \
apache2-prefork-dev autoconf binutils build-essential bzip2 \
comerr-dev cpp cpp-4.6 dpkg-dev g++ g++-4.6 gcc gcc-4.6 krb5-multidev \
libapr1-dev libaprutil1-dev libaspell-dev libbz2-dev \
libc-client2007e-dev libc-dev-bin libc6-dev \
libcurl4-openssl-dev libdpkg-perl libexpat1-dev \
libfreetype6-dev libgcrypt11-dev libgdbm-dev libgmp10 libgnutls-dev \
libgnutls-openssl27 libgnutlsxx27 libgomp1 libgpg-error-dev \
libgssrpc4 libice-dev libice6 libidn11-dev \
libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev \
libkadm5clnt-mit8 libkadm5srv-mit8 libkdb5-6 \
libkrb5-dev libldap2-dev libltdl-dev libltdl7 \
libmagic-dev libmcrypt-dev libmhash-dev \
libmpc2 libmpfr4 libmysqlclient-dev libncurses5-dev \
libp11-kit-dev libpam0g-dev libpcre3-dev libpcrecpp0 libpng12-dev libpopt0 \
libpq-dev libpq5 libpspell-dev libpthread-stubs0 libpthread-stubs0-dev \
libquadmath0 libreadline-dev libreadline6-dev librtmp-dev \
libsm-dev libsm6 libsqlite3-dev libssl-dev libstdc++6-4.6-dev \
libt1-dev libtasn1-3-dev libtimedate-perl libtinfo-dev \
libx11-dev libxau-dev libxaw7 libxaw7-dev libxcb1-dev \
libxdmcp-dev libxext-dev libxext6 libxml2-dev libxmu-dev \
libxmu-headers libxmu6 libxpm-dev libxpm4 libxt-dev libxt6 linux-libc-dev \
m4 make patch pkg-config uuid-dev wget \
x11-common x11proto-core-dev x11proto-input-dev x11proto-kb-dev \
x11proto-xext-dev xorg-sgml-doctools xtrans-dev zlib1g-dev \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY php.ini /etc/php/apache2-php5.2/
COPY php.ini /etc/php/cli-php5.2/
EXPOSE 80
CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]