summaryrefslogtreecommitdiffstats
path: root/php-8.0-opt/build.Dockerfile
blob: 29e6e5c34a4b1808d6e1f6bcf04011f88eaa3063 (plain)
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
FROM debian/eol:wheezy

ENV MAIN_PREFIX_NO_ROOT opt/php-8.0
ENV MAIN_PREFIX /$MAIN_PREFIX_NO_ROOT
ENV DEP_PREFIX $MAIN_PREFIX/dependencies
ENV PACKAGE_NAME php-8.0.0-opt

RUN apt-get update \
  && apt-get install -y \
      curl \
      build-essential \
      net-tools \
      autoconf \
      pkg-config \
      wget \
      libkrb5-dev \
      libssl-dev \
      libsqlite3-dev \
      libbz2-dev \
      libpng12-dev libjpeg8-dev \
      libfreetype6-dev \
      libc-client-dev \
      libpq-dev \
      libxslt1-dev \
      checkinstall \
      zlib1g-dev \
      libtool \
      bison \
      libgmp-dev \
      libtidy-dev \
      libgd2-xpm-dev \
      libmagickwand-dev \
      libmagickcore-dev \
      python-dev \
      libldap2-dev
RUN wget https://curl.se/download/curl-7.73.0.tar.gz
RUN tar xzf curl-7.73.0.tar.gz
RUN cd curl-7.73.0 \
  && ./configure --prefix=$DEP_PREFIX \
  && make \
  && make install \
  && checkinstall -y --pkgname $PACKAGE_NAME-libcurl
RUN curl https://gitlab.gnome.org/GNOME/libxml2/-/archive/v2.9.10/libxml2-v2.9.10.tar.gz > libxml2-v2.9.10.tar.gz
RUN tar xzf libxml2-v2.9.10.tar.gz
RUN cd libxml2-v2.9.10 \
  && ./autogen.sh --prefix=$DEP_PREFIX \
  && make \
  && make install \
  && checkinstall -y --pkgname $PACKAGE_NAME-libxml2
RUN wget https://cmake.org/files/v2.8/cmake-2.8.12.1.tar.gz
RUN tar xzf cmake-2.8.12.1.tar.gz
RUN cd cmake-2.8.12.1 \
  && ./bootstrap \
  && make \
  && make install
RUN wget https://github.com/libjpeg-turbo/libjpeg-turbo/archive/2.0.6.tar.gz -O libjpeg-turbo-2.0.6.tar.gz
RUN tar xzf libjpeg-turbo-2.0.6.tar.gz
RUN cd libjpeg-turbo-2.0.6 \
  && mkdir build \
  && cd build \
  && cmake -DCMAKE_INSTALL_PREFIX=$DEP_PREFIX -DCMAKE_BUILD_TYPE=RELEASE -DENABLE_STATIC=FALSE -DCMAKE_INSTALL_DEFAULT_LIBDIR=lib .. \
  && make \
  && checkinstall -y --pkgname $PACKAGE_NAME-libjpeg-turbo --pkgversion 1
RUN ln -s /usr/lib/libc-client.a /usr/lib/x86_64-linux-gnu/libc-client.a
RUN wget https://web.mit.edu/kerberos/dist/krb5/1.17/krb5-1.17.2.tar.gz
RUN tar xzf krb5-1.17.2.tar.gz
RUN cd krb5-1.17.2/src \
  && ./configure --prefix=$DEP_PREFIX \
  && make \
  && checkinstall -y --pkgname $PACKAGE_NAME-krb5 --pkgversion 1
RUN wget https://github.com/unicode-org/icu/releases/download/release-50-2/icu4c-50_2-src.tgz
RUN tar xzf icu4c-50_2-src.tgz
RUN cd icu/source/ \
  && ./configure --prefix=$DEP_PREFIX \
  && make \
  && checkinstall -y --pkgname $PACKAGE_NAME-icu --pkgversion 1
RUN wget https://github.com/kkos/oniguruma/archive/v6.9.6.tar.gz
RUN tar xzf v6.9.6.tar.gz
RUN cd oniguruma-6.9.6 \
  && autoreconf -vfi \
  && ./configure --prefix=$DEP_PREFIX \
  && make \
  && checkinstall -y --pkgname $PACKAGE_NAME-oniguruma
RUN wget https://libzip.org/download/libzip-0.11.2.tar.gz
RUN tar xzf libzip-0.11.2.tar.gz
# in this case checkinstall only works after "make install"
RUN cd libzip-0.11.2 \
  && ./configure --prefix=$DEP_PREFIX \
  && make \
  && make install \
  && checkinstall -y --pkgname $PACKAGE_NAME-libzip
RUN wget https://github.com/libgd/libgd/releases/download/gd-2.1.1/libgd-2.1.1.tar.gz
RUN tar xzf libgd-2.1.1.tar.gz
RUN cd libgd-2.1.1 \
  && ./configure --prefix=$DEP_PREFIX \
  && make \
  && checkinstall -y --pkgname $PACKAGE_NAME-libgd
RUN curl https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz > libsodium-1.0.18.tar.gz
RUN tar xzf libsodium-1.0.18.tar.gz
RUN cd libsodium-1.0.18 \
  && ./configure --prefix=$DEP_PREFIX \
  && make \
  && checkinstall -y --pkgname $PACKAGE_NAME-libsodium
RUN wget https://www.php.net/distributions/php-8.0.0.tar.gz
RUN tar xzf php-8.0.0.tar.gz
RUN cd php-8.0.0 \
  && PKG_CONFIG_PATH=$DEP_PREFIX/lib/pkgconfig ./configure \
      --prefix=$MAIN_PREFIX \
      #--with-libdir=/lib/x86_64-linux-gnu \
      #--disable-rpath \
      --enable-static \
      --enable-bcmath \
      --enable-calendar \
      --enable-exif \
      --enable-fpm \
      --enable-ftp \
      --enable-gd \
      --enable-intl \
      --enable-mbstring \
      --enable-pcntl \
      --enable-pdo \
      --enable-shmop \
      --enable-soap \
      --enable-sockets \
      --enable-sysvsem \
      --enable-sysvshm \
      --enable-zip \
      --with-bz2 \
      --with-config-file-path=$MAIN_PREFIX/etc \
      --with-config-file-scan-dir=$MAIN_PREFIX/etc/conf.d \
      --with-curl \
      --with-external-gd \
      --with-freetype \
      --with-gettext \
      --with-gmp \
      --with-imap \
      --with-imap-ssl \
      --with-jpeg \
      --with-kerberos \
      --with-ldap=shared \
      --with-mhash \
      --with-mysql-sock=/var/run/mysqld/mysqld.sock \
      --with-mysqli \
      --with-openssl \
      --with-pdo-mysql \
      --with-pdo-sqlite \
      --with-pear \
      --with-sodium \
      --with-sqlite3 \
      --with-tidy \
      --with-xmlrpc \
      --with-xpm \
      --with-xsl \
      --with-zip \
      --with-zlib \
  && make
RUN cd php-8.0.0 \
  && mkdir -p $MAIN_PREFIX_NO_ROOT/etc/conf.d \
  && cp php.ini-production $MAIN_PREFIX_NO_ROOT/etc/php.ini \
  && sed -i -E 's/^short_open_tag =.+$/short_open_tag = On/' $MAIN_PREFIX_NO_ROOT/etc/php.ini \
  && sed -i -E 's/^expose_php =.+$/expose_php = Off/' $MAIN_PREFIX_NO_ROOT/etc/php.ini \
  && sed -i -E 's/^memory_limit =.+$/memory_limit = 256M/' $MAIN_PREFIX_NO_ROOT/etc/php.ini \
  && sed -i -E 's/^;?date\.timezone =.*$/date.timezone = Europe\/Berlin/' $MAIN_PREFIX_NO_ROOT/etc/php.ini \
  && sed -i -E 's/^mail\.add_x_header =.+$/mail.add_x_header = On/' $MAIN_PREFIX_NO_ROOT/etc/php.ini \
  && echo zend_extension=opcache.so > $MAIN_PREFIX_NO_ROOT/etc/conf.d/opcache.ini \
  && echo $MAIN_PREFIX_NO_ROOT/etc/php.ini >> files_to_add \
  && echo $MAIN_PREFIX_NO_ROOT/etc/conf.d/opcache.ini >> files_to_add \
  && checkinstall -y --pkgname $PACKAGE_NAME --include files_to_add
RUN cd /php-8.0.0/ext \
  && wget https://github.com/Imagick/imagick/archive/3.4.4.tar.gz \
  && tar xzf 3.4.4.tar.gz \
  && cd imagick-3.4.4 \
  && $MAIN_PREFIX/bin/phpize \
  && ./configure --with-php-config=$MAIN_PREFIX/bin/php-config \
  && make
RUN cd /php-8.0.0/ext/imagick-3.4.4 \
  && mkdir -p $MAIN_PREFIX_NO_ROOT/etc/conf.d \
  && echo extension=imagick.so > $MAIN_PREFIX_NO_ROOT/etc/conf.d/imagick.ini \
  && echo $MAIN_PREFIX_NO_ROOT/etc/conf.d/imagick.ini >> files_to_add \
  && checkinstall -y --pkgname $PACKAGE_NAME-imagick --include files_to_add
RUN cd /php-8.0.0/ext \
  && wget https://github.com/krakjoe/apcu/archive/v5.1.19.tar.gz \
  && tar xzf v5.1.19.tar.gz \
  && cd apcu-5.1.19 \
  && $MAIN_PREFIX/bin/phpize \
  && ./configure --with-php-config=$MAIN_PREFIX/bin/php-config \
  && make
RUN cd /php-8.0.0/ext/apcu-5.1.19 \
  && mkdir -p $MAIN_PREFIX_NO_ROOT/etc/conf.d \
  && echo extension=apcu.so > $MAIN_PREFIX_NO_ROOT/etc/conf.d/apcu.ini \
  && echo $MAIN_PREFIX_NO_ROOT/etc/conf.d/apcu.ini >> files_to_add \
  && checkinstall -y --pkgname $PACKAGE_NAME-apcu --include files_to_add