-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from devilbox/release-0.52
Build multi-flavour
- Loading branch information
Showing
25 changed files
with
34,404 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM debian:stretch | ||
FROM debian:stretch-slim | ||
MAINTAINER "cytopia" <cytopia@everythingcli.org> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
FROM debian:jessie-slim | ||
MAINTAINER "cytopia" <cytopia@everythingcli.org> | ||
|
||
|
||
ENV PHP_VERSION 5.2.17 | ||
ENV PHP_INI_DIR /usr/local/etc/php | ||
|
||
ENV BUILD_DEPS \ | ||
autoconf2.13 \ | ||
libbison-dev \ | ||
libcurl4-openssl-dev \ | ||
libfl-dev \ | ||
libmysqlclient-dev \ | ||
libpcre3-dev \ | ||
libreadline6-dev \ | ||
librecode-dev \ | ||
libsqlite3-dev \ | ||
libssl-dev \ | ||
libxml2-dev \ | ||
patch | ||
|
||
|
||
# Setup directories | ||
RUN set -eux \ | ||
&& mkdir -p ${PHP_INI_DIR}/conf.d \ | ||
&& mkdir -p /usr/src/php | ||
|
||
|
||
# persistent / runtime deps | ||
RUN set -eux \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends --no-install-suggests \ | ||
ca-certificates \ | ||
curl \ | ||
libpcre3 \ | ||
librecode0 \ | ||
libmysqlclient18 \ | ||
libsqlite3-0 \ | ||
libxml2 \ | ||
&& apt-get clean \ | ||
&& rm -r /var/lib/apt/lists/* | ||
|
||
|
||
# phpize deps | ||
RUN set -eux \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends --no-install-suggests \ | ||
autoconf \ | ||
dpkg-dev \ | ||
file \ | ||
g++ \ | ||
gcc \ | ||
libc-dev \ | ||
make \ | ||
pkg-config \ | ||
re2c \ | ||
xz-utils \ | ||
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ | ||
apt-get install -y --no-install-recommends --no-install-suggests \ | ||
g++-multilib \ | ||
gcc-multilib; \ | ||
fi \ | ||
&& apt-get clean \ | ||
&& rm -r /var/lib/apt/lists/* | ||
|
||
|
||
# compile openssl, otherwise --with-openssl won't work | ||
RUN set -eux \ | ||
&& OPENSSL_VERSION="1.0.2g" \ | ||
&& cd /tmp \ | ||
&& mkdir openssl \ | ||
&& update-ca-certificates \ | ||
&& curl -sS -k -L --fail "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz" -o openssl.tar.gz \ | ||
&& curl -sS -k -L --fail "https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz.asc" -o openssl.tar.gz.asc \ | ||
&& tar -xzf openssl.tar.gz -C openssl --strip-components=1 \ | ||
&& cd /tmp/openssl \ | ||
&& if [ "$(dpkg-architecture --query DEB_HOST_ARCH)" = "i386" ]; then \ | ||
setarch i386 ./config -m32; \ | ||
else \ | ||
./config; \ | ||
fi \ | ||
&& make depend \ | ||
&& make -j"$(nproc)" \ | ||
&& make install \ | ||
&& rm -rf /tmp/openssl* \ | ||
# Ensure libs are linked to correct architecture directory | ||
&& debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)" \ | ||
&& mkdir -p "/usr/local/ssl/lib/${debMultiarch}" \ | ||
&& ln -s /usr/local/ssl/lib/* "/usr/local/ssl/lib/${debMultiarch}/" | ||
|
||
|
||
# php 5.2 needs older autoconf | ||
RUN set -eux \ | ||
&& set -x \ | ||
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends --no-install-suggests \ | ||
${BUILD_DEPS} \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
# Copy and apply patches to PHP | ||
COPY data/php-${PHP_VERSION}*.patch /tmp/ | ||
RUN set -eux \ | ||
&& curl -sS -k -L --fail "http://museum.php.net/php5/php-${PHP_VERSION}.tar.gz" -o /usr/src/php.tar.gz \ | ||
\ | ||
# Extract artifacts | ||
&& tar -xf /usr/src/php.tar.gz -C /usr/src/php --strip-components=1 \ | ||
# Apply patches | ||
&& cd /usr/src/php \ | ||
&& patch -p1 < /tmp/php-${PHP_VERSION}-libxml2.patch \ | ||
&& patch -p1 < /tmp/php-${PHP_VERSION}-openssl.patch \ | ||
&& patch -p1 < /tmp/php-${PHP_VERSION}-fpm.patch \ | ||
&& (patch -p0 < /tmp/php-${PHP_VERSION}-curl.patch || true) \ | ||
# Create php.tar.xz | ||
&& cd /usr/src \ | ||
&& tar -cJf php.tar.xz php \ | ||
# Clean-up | ||
&& rm -rf php php.tar.gz \ | ||
&& rm -rf /tmp/php-* | ||
|
||
|
||
COPY data/docker-php-source /usr/local/bin/ | ||
RUN set -eux \ | ||
&& apt update \ | ||
&& apt install --no-install-recommends --no-install-suggests \ | ||
flex -y \ | ||
&& docker-php-source extract \ | ||
&& cd /usr/src/php \ | ||
&& gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \ | ||
&& debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)" \ | ||
\ | ||
# https://bugs.php.net/bug.php?id=74125 | ||
&& if [ ! -d /usr/include/curl ]; then \ | ||
ln -sT "/usr/include/${debMultiarch}/curl" /usr/local/include/curl; \ | ||
fi \ | ||
\ | ||
&& ./configure \ | ||
--host="${gnuArch}" \ | ||
--with-libdir="/lib/${debMultiarch}/" \ | ||
--with-config-file-path="${PHP_INI_DIR}" \ | ||
--with-config-file-scan-dir="${PHP_INI_DIR}/conf.d" \ | ||
--with-fpm-conf="/usr/local/etc/php-fpm.conf" \ | ||
\ | ||
--enable-fastcgi \ | ||
--enable-fpm \ | ||
--enable-force-cgi-redirect \ | ||
\ | ||
--enable-mbstring \ | ||
--enable-pdo \ | ||
--enable-soap \ | ||
\ | ||
--with-curl \ | ||
--with-mysql \ | ||
--with-mysqli \ | ||
--with-openssl=/usr/local/ssl \ | ||
--with-pdo-mysql \ | ||
--with-readline \ | ||
--with-zlib \ | ||
&& make -j"$(nproc)" \ | ||
&& make install \ | ||
&& php -v \ | ||
# Clean-up | ||
&& { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \ | ||
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false ${BUILD_DEPS} \ | ||
&& make clean \ | ||
&& cd / \ | ||
&& docker-php-source delete | ||
|
||
|
||
WORKDIR /var/www/html | ||
COPY data/docker-php-* /usr/local/bin/ | ||
COPY data/php-fpm /usr/local/sbin/php-fpm | ||
COPY data/php-fpm.conf /usr/local/etc/ | ||
COPY data/php.ini /usr/local/etc/php/php.ini | ||
|
||
|
||
EXPOSE 9000 | ||
ENTRYPOINT ["php-fpm"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Dockerfile.jessie |
Oops, something went wrong.