From 842e24af493609c012392d484ca984b448c5a5ee Mon Sep 17 00:00:00 2001 From: hoellen Date: Thu, 11 Jan 2018 15:11:45 +0100 Subject: [PATCH] [nginx-php] create php 7.2 tag --- nginx-php/{7.1/Dockerfile => Dockerfile.7.1} | 0 nginx-php/Dockerfile.7.2 | 183 ++++++++++++++++++ .../rootfs/etc/s6.d/.s6-svscan/finish | 0 nginx-php/{7.1 => }/rootfs/etc/s6.d/nginx/run | 0 nginx-php/{7.1 => }/rootfs/etc/s6.d/php/run | 0 .../{7.1 => }/rootfs/nginx/conf.d/php.conf | 0 .../{7.1 => }/rootfs/nginx/conf/nginx.conf | 0 .../{7.1 => }/rootfs/php/etc/php-fpm.conf | 0 .../usr/local/bin/docker-php-ext-configure | 0 .../usr/local/bin/docker-php-ext-enable | 0 .../usr/local/bin/docker-php-ext-install | 0 11 files changed, 183 insertions(+) rename nginx-php/{7.1/Dockerfile => Dockerfile.7.1} (100%) create mode 100644 nginx-php/Dockerfile.7.2 rename nginx-php/{7.1 => }/rootfs/etc/s6.d/.s6-svscan/finish (100%) rename nginx-php/{7.1 => }/rootfs/etc/s6.d/nginx/run (100%) rename nginx-php/{7.1 => }/rootfs/etc/s6.d/php/run (100%) rename nginx-php/{7.1 => }/rootfs/nginx/conf.d/php.conf (100%) rename nginx-php/{7.1 => }/rootfs/nginx/conf/nginx.conf (100%) rename nginx-php/{7.1 => }/rootfs/php/etc/php-fpm.conf (100%) rename nginx-php/{7.1 => }/rootfs/usr/local/bin/docker-php-ext-configure (100%) rename nginx-php/{7.1 => }/rootfs/usr/local/bin/docker-php-ext-enable (100%) rename nginx-php/{7.1 => }/rootfs/usr/local/bin/docker-php-ext-install (100%) diff --git a/nginx-php/7.1/Dockerfile b/nginx-php/Dockerfile.7.1 similarity index 100% rename from nginx-php/7.1/Dockerfile rename to nginx-php/Dockerfile.7.1 diff --git a/nginx-php/Dockerfile.7.2 b/nginx-php/Dockerfile.7.2 new file mode 100644 index 0000000..896d90f --- /dev/null +++ b/nginx-php/Dockerfile.7.2 @@ -0,0 +1,183 @@ +FROM alpine:3.7 + +ARG BUILD_CORES + +ARG NGINX_VER=1.13.8 +ARG PHP_VER=7.2.1 +ARG LIBICONV_VERSION=1.15 + +LABEL description="nginx + php image based on Alpine" \ + maintainer="hoellen info@hoellen.eu" \ + php_version="PHP v$PHP_VER built from source" \ + nginx_version="nginx v$NGINX_VER built from source" + +ARG PHP_MIRROR=http://ch1.php.net + +ARG NGINX_CONF=" \ + --prefix=/nginx \ + --sbin-path=/usr/local/sbin/nginx \ + --http-log-path=/nginx/logs/access.log \ + --error-log-path=/nginx/logs/error.log \ + --pid-path=/nginx/run/nginx.pid \ + --lock-path=/nginx/run/nginx.lock \ + --with-threads \ + --with-file-aio \ + --without-http_geo_module \ + --without-http_autoindex_module \ + --without-http_split_clients_module \ + --without-http_memcached_module \ + --without-http_empty_gif_module \ + --without-http_browser_module" + +ARG PHP_CONF=" \ + --prefix=/usr \ + --libdir=/usr/lib/php \ + --datadir=/usr/share/php \ + --sysconfdir=/php/etc \ + --localstatedir=/php/var \ + --with-pear=/usr/share/php \ + --with-config-file-scan-dir=/php/conf.d \ + --with-config-file-path=/php \ + --with-pic \ + --disable-short-tags \ + --without-readline \ + --enable-bcmath=shared \ + --enable-fpm \ + --disable-cgi \ + --enable-mysqlnd \ + --enable-mbstring \ + --with-curl \ + --with-libedit \ + --with-openssl \ + --with-iconv=/usr/local \ + --with-gd \ + --with-jpeg-dir \ + --with-png-dir \ + --with-webp-dir \ + --with-xpm-dir=no \ + --with-freetype-dir \ + --disable-gd-jis-conv \ + --with-zlib" + +ARG PHP_EXT_LIST=" \ + mysqli \ + ctype \ + dom \ + json \ + xml \ + mbstring \ + posix \ + xmlwriter \ + zip \ + zlib \ + sqlite3 \ + pdo_sqlite \ + pdo_pgsql \ + pdo_mysql \ + pcntl \ + curl \ + fileinfo \ + bz2 \ + intl \ + mcrypt \ + openssl \ + ldap \ + simplexml \ + pgsql \ + ftp \ + exif \ + gmp \ + imap" + +ARG CUSTOM_BUILD_PKGS=" \ + freetype-dev \ + openldap-dev \ + gmp-dev \ + libmcrypt-dev \ + icu-dev \ + postgresql-dev \ + libpng-dev \ + libwebp-dev \ + gd-dev \ + libjpeg-turbo-dev \ + libxpm-dev \ + libedit-dev \ + libxml2-dev \ + libressl-dev \ + libbz2 \ + sqlite-dev \ + imap-dev" + +ARG CUSTOM_PKGS=" \ + freetype \ + openldap \ + gmp \ + libmcrypt \ + bzip2-dev \ + icu \ + libpq \ + c-client" + +COPY rootfs / + +RUN NB_CORES=${BUILD_CORES-$(getconf _NPROCESSORS_CONF)} \ + && BUILD_DEPS=" \ + linux-headers \ + libtool \ + build-base \ + pcre-dev \ + zlib-dev \ + wget \ + gnupg \ + autoconf \ + gcc \ + g++ \ + libc-dev \ + make \ + pkgconf \ + curl-dev \ + ca-certificates \ + ${CUSTOM_BUILD_PKGS}" \ + && apk -U add \ + ${BUILD_DEPS} \ + s6 \ + su-exec \ + curl \ + libedit \ + libxml2 \ + libressl \ + libwebp \ + gd \ + pcre \ + zlib \ + ${CUSTOM_PKGS} \ + && wget http://nginx.org/download/nginx-${NGINX_VER}.tar.gz -O /tmp/nginx-${NGINX_VER}.tar.gz \ + && wget http://nginx.org/download/nginx-${NGINX_VER}.tar.gz.asc -O /tmp/nginx-${NGINX_VER}.tar.gz.asc \ + && wget ${PHP_MIRROR}/get/php-${PHP_VER}.tar.gz/from/this/mirror -O /tmp/php-${PHP_VER}.tar.gz \ + && wget ${PHP_MIRROR}/get/php-${PHP_VER}.tar.gz.asc/from/this/mirror -O /tmp/php-${PHP_VER}.tar.gz.asc \ + && wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-${LIBICONV_VERSION}.tar.gz -O /tmp/libiconv-${LIBICONV_VERSION}.tar.gz \ + && mkdir -p /php/conf.d \ + && mkdir -p /usr/src \ + && tar xzf /tmp/nginx-${NGINX_VER}.tar.gz -C /usr/src \ + && tar xzvf /tmp/php-${PHP_VER}.tar.gz -C /usr/src \ + && tar xzf /tmp/libiconv-${LIBICONV_VERSION}.tar.gz -C /usr/src \ + && cd /usr/src/nginx-${NGINX_VER} \ + && ./configure --with-cc-opt="-O3 -fPIE -fstack-protector-strong" ${NGINX_CONF} \ + && make -j ${NB_CORES} \ + && make install \ + && cd /usr/src/libiconv-${LIBICONV_VERSION} \ + && ./configure --prefix=/usr/local \ + && make && make install && libtool --finish /usr/local/lib \ + && mv /usr/src/php-${PHP_VER} /usr/src/php \ + && cd /usr/src/php \ + && ./configure CFLAGS="-O3 -fstack-protector-strong" ${PHP_CONF} \ + && make -j ${NB_CORES} \ + && make install \ + && { find /usr/local/bin /usr/local/sbin -type f -perm +0111 -exec strip --strip-all '{}' + || true; } \ + && make clean \ + && chmod u+x /usr/local/bin/* /etc/s6.d/*/* \ + && sleep 1 \ + && docker-php-ext-install ${PHP_EXT_LIST} \ + && apk del ${BUILD_DEPS} \ + && rm -rf /tmp/* /var/cache/apk/* /usr/src/* \ + && mkdir -p /nginx/logs /nginx/run /php/php-fpm.d /php/logs /php/run /php/session diff --git a/nginx-php/7.1/rootfs/etc/s6.d/.s6-svscan/finish b/nginx-php/rootfs/etc/s6.d/.s6-svscan/finish similarity index 100% rename from nginx-php/7.1/rootfs/etc/s6.d/.s6-svscan/finish rename to nginx-php/rootfs/etc/s6.d/.s6-svscan/finish diff --git a/nginx-php/7.1/rootfs/etc/s6.d/nginx/run b/nginx-php/rootfs/etc/s6.d/nginx/run similarity index 100% rename from nginx-php/7.1/rootfs/etc/s6.d/nginx/run rename to nginx-php/rootfs/etc/s6.d/nginx/run diff --git a/nginx-php/7.1/rootfs/etc/s6.d/php/run b/nginx-php/rootfs/etc/s6.d/php/run similarity index 100% rename from nginx-php/7.1/rootfs/etc/s6.d/php/run rename to nginx-php/rootfs/etc/s6.d/php/run diff --git a/nginx-php/7.1/rootfs/nginx/conf.d/php.conf b/nginx-php/rootfs/nginx/conf.d/php.conf similarity index 100% rename from nginx-php/7.1/rootfs/nginx/conf.d/php.conf rename to nginx-php/rootfs/nginx/conf.d/php.conf diff --git a/nginx-php/7.1/rootfs/nginx/conf/nginx.conf b/nginx-php/rootfs/nginx/conf/nginx.conf similarity index 100% rename from nginx-php/7.1/rootfs/nginx/conf/nginx.conf rename to nginx-php/rootfs/nginx/conf/nginx.conf diff --git a/nginx-php/7.1/rootfs/php/etc/php-fpm.conf b/nginx-php/rootfs/php/etc/php-fpm.conf similarity index 100% rename from nginx-php/7.1/rootfs/php/etc/php-fpm.conf rename to nginx-php/rootfs/php/etc/php-fpm.conf diff --git a/nginx-php/7.1/rootfs/usr/local/bin/docker-php-ext-configure b/nginx-php/rootfs/usr/local/bin/docker-php-ext-configure similarity index 100% rename from nginx-php/7.1/rootfs/usr/local/bin/docker-php-ext-configure rename to nginx-php/rootfs/usr/local/bin/docker-php-ext-configure diff --git a/nginx-php/7.1/rootfs/usr/local/bin/docker-php-ext-enable b/nginx-php/rootfs/usr/local/bin/docker-php-ext-enable similarity index 100% rename from nginx-php/7.1/rootfs/usr/local/bin/docker-php-ext-enable rename to nginx-php/rootfs/usr/local/bin/docker-php-ext-enable diff --git a/nginx-php/7.1/rootfs/usr/local/bin/docker-php-ext-install b/nginx-php/rootfs/usr/local/bin/docker-php-ext-install similarity index 100% rename from nginx-php/7.1/rootfs/usr/local/bin/docker-php-ext-install rename to nginx-php/rootfs/usr/local/bin/docker-php-ext-install