-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
136 lines (129 loc) · 3.12 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
FROM ubuntu:__UBUNTU_RELEASE__
MAINTAINER Kevin Quinn "kevin.quinn@totalserversolutions.com"
ENV PHP_VERSION __PHP_VERSION__
ENV PHP_SHA __PHP_SHA__
ENV UBUNTU_RELEASE __UBUNTU_RELEASE__
# Install tools needed by install scripts below
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
RUN apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:ubuntu-toolchain-r/test
RUN apt-get -y update
RUN apt-get -y install gcc-5
RUN apt-get -y install curl \
sudo \
wget \
build-essential \
autoconf \
automake \
libtool \
re2c \
flex \
bison \
gcc-5 \
libxml2-dev \
libssl-dev \
libcurl4-openssl-dev \
pkg-config \
pkg-config \
libpcre3-dev \
sqlite3 \
libsqlite3-dev \
libbz2-dev \
libgdbm-dev \
libgdbm-dev \
libdb*-dev \
libdb4o-cil-dev \
libpng12-dev \
libxpm-dev \
libfreetype6-dev \
libgd-dev \
libgmp-dev \
libgmp3-dev \
libicu-dev \
icu-devtools \
g++ \
mysql-common \
mysql-client \
libmysqlclient-dev \
libpq-dev \
libpspell-dev \
librecode-dev \
libqxmlrpc-dev \
libtidy-dev \
libxslt1-dev
# Download php
WORKDIR /tmp
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 100
RUN curl -L https://github.com/php/php-src/archive/${PHP_SHA}.tar.gz | tar xvz
# Build php
RUN rm -rf /usr/local/include && ln -fs /usr/include/x86_64-linux-gnu /usr/local/include
WORKDIR /tmp/php-src-${PHP_SHA}/
RUN ./buildconf --force
RUN ./configure \
--prefix=/usr \
--build=x86_64-linux-gnu \
--host=x86_64-linux-gnu \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/share/man \
--disable-debug \
--disable-rpath \
--disable-static \
--with-pic \
--with-layout=GNU \
--with-pear=/usr/share/php \
--enable-calendar \
--enable-bcmath \
--with-bz2 \
--enable-ctype \
--without-gdbm \
--with-iconv \
--enable-exif \
--with-gettext \
--enable-mbstring \
--with-pcre-regex \
--enable-shmop \
--enable-sockets \
--enable-wddx \
--with-libxml-dir=/usr \
--with-zlib \
--with-kerberos=/usr \
--with-openssl \
--with-openssl-dir=/usr/lib/x86_64-linux-gnu/openssl-1.0.0/ \
--enable-soap \
--enable-zip \
--with-mhash=yes \
--with-mysql-sock=/var/run/mysqld/mysqld.sock \
--without-mm \
--with-curl=shared,/usr \
--with-zlib-dir=/usr \
--with-gd=shared,/usr \
--enable-gd-native-ttf \
--with-gmp=shared \
--with-jpeg-dir=shared,/usr \
--with-xpm-dir=shared,/usr/X11R6 \
--with-png-dir=shared,/usr \
--with-freetype-dir=shared,/usr \
--enable-intl=shared \
--with-mysqli=shared,/usr/bin/mysql_config \
--with-pspell=shared,/usr \
--with-recode=shared,/usr \
--with-xsl=shared,/usr \
--with-tidy=shared,/usr \
--with-xmlrpc=shared \
--enable-fpm
# Install wordpress to train php against
WORKDIR /tmp
RUN curl https://wordpress.org/latest.tar.gz | tar xzv
RUN apt-get -y install checkinstall
WORKDIR /tmp/php-src-${PHP_SHA}/
RUN make clean
RUN make -j2 prof-gen
RUN sapi/cgi/php-cgi -T 1000 /tmp/wordpress/index.php
RUN make prof-clean
RUN make -j2 prof-use
RUN checkinstall -y -D --pkgversion=${PHP_VERSION} \
--pkgname="php-wordpress-optimized" \
--pkgrelease=${PHP_RELEASE} \
--maintainer="kevin.quinn@totalserversolutions.com" \
make install