Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Commit

Permalink
Updated template dir.
Browse files Browse the repository at this point in the history
  • Loading branch information
MickMake committed Jun 20, 2018
1 parent da40b8c commit c60019f
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 18 deletions.
4 changes: 3 additions & 1 deletion template/DockerfileRuntime
Expand Up @@ -33,9 +33,11 @@ RUN /bin/sh /build/build.sh && \
mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail && \
/bin/sh /build/cleanup.sh

COPY files /

# cd / && tar xf /tmp/tarball

WORKDIR /var/www
# USER vagrant
# ENTRYPOINT ["/usr/local/bin/php-entrypoint"]
CMD ["/usr/sbin/php-fpm", "-x"]
CMD ["/usr/sbin/php-fpm", "-F"]
11 changes: 6 additions & 5 deletions template/Dockerfile → template/DockerfileTarball
@@ -1,4 +1,5 @@
FROM alpine:3.7
# FROM wplib/php-base:%%VERSION%%

MAINTAINER WPLib Team <team@wplib.org>

Expand All @@ -25,13 +26,13 @@ USER root
COPY build/* /build/
COPY container.json /etc/container.json
COPY files /
COPY tarball /tmp

RUN /bin/sh /build/build.sh && \
wget -nv https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64 && \
mv mhsendmail_linux_amd64 /usr/local/bin/mhsendmail && \
chmod a+x /usr/local/bin/*
RUN cd / && tar xf /tmp/tarball && /bin/sh /build/cleanup.sh && rm /tmp/tarball

COPY files /

WORKDIR /var/www
USER vagrant
# USER vagrant
# ENTRYPOINT ["/usr/local/bin/php-entrypoint"]
CMD ["/usr/sbin/php-fpm", "-F"]
2 changes: 1 addition & 1 deletion template/build/allow-build-recode-and-imap-together.patch
Expand Up @@ -3,7 +3,7 @@ together, and that's what we want.

Source: https://src.fedoraproject.org/cgit/rpms/php.git/tree/php-5.3.0-recode.patch?h=f26
--- a/ext/recode/config9.m4
+++ php-7.2.6/ext/recode/config9.m4
+++ php-%%VERSION%%/ext/recode/config9.m4
@@ -4,13 +4,6 @@ dnl

dnl Check for extensions with which Recode can not work
Expand Down
36 changes: 29 additions & 7 deletions template/build/build.sh
@@ -1,6 +1,7 @@
#!/bin/sh

# ssh-keygen -A
BUILDDIR="/build"


checkExit()
Expand All @@ -13,21 +14,19 @@ checkExit()
}


if [ ! -d /build ]
if [ ! -d ${BUILDDIR} ]
then
echo "# WPLib Box: /build doesn't exist."
echo "# WPLib Box: ${BUILDDIR} doesn't exist."
exit
fi


# BUILD_DEPS="build-base autoconf apache2-dev aspell-dev bison bzip2-dev curl-dev db-dev enchant-dev freetds-dev freetype-dev gdbm-dev gettext-dev gmp-dev icu-dev imap-dev krb5-dev libedit-dev libical-dev libjpeg-turbo-dev libpng-dev libressl-dev libsodium-dev libwebp-dev libxml2-dev libxpm-dev libxslt-dev libzip-dev net-snmp-dev openldap-dev pcre-dev postgresql-dev re2c recode-dev sqlite-dev tidyhtml-dev unixodbc-dev zlib-dev imagemagick autoconf binutils bison coreutils fakeroot file g++ gcc gnupg gpgme libarchive libarchive-tools libcurl libintl libressl2.6-libcrypto make musl pacman pkgconf re2c rsync aspell-dev bzip2-dev curl-dev db-dev dpkg-dev enchant-dev freetds-dev freetype-dev gdbm-dev gmp-dev icu-dev imagemagick-dev imap-dev jpeg-dev libc-dev libedit-dev libmcrypt-dev libpng-dev readline-dev libressl-dev libxml2-dev libxpm-dev libxslt-dev musl-dev net-snmp-dev openldap-dev pcre-dev postgresql-dev sqlite-dev unixodbc-dev"
BUILD_BINS="autoconf binutils bison build-base coreutils fakeroot file g++ gcc gnupg gpgme imagemagick libarchive libarchive-tools libcurl libintl libressl2.6-libcrypto make musl pacman pkgconf re2c rsync"
BUILD_LIBS="apache2-dev aspell-dev bzip2-dev curl-dev db-dev dpkg-dev enchant-dev freetds-dev freetype-dev gdbm-dev gettext-dev gmp-dev icu-dev imagemagick-dev imap-dev jpeg-dev krb5-dev libc-dev libedit-dev libical-dev libjpeg-turbo-dev libmcrypt-dev libpng-dev libressl-dev libsodium-dev libwebp-dev libxml2-dev libxpm-dev libxslt-dev libzip-dev musl-dev net-snmp-dev openldap-dev pcre-dev postgresql-dev readline-dev recode-dev sqlite-dev tidyhtml-dev unixodbc-dev zlib-dev"
BUILD_BINS="autoconf binutils bison build-base coreutils fakeroot file g++ gcc gnupg gpgme libarchive-tools make musl pacman pkgconf re2c rsync"
BUILD_LIBS="apache2-dev aspell-dev bzip2-dev curl-dev db-dev dpkg-dev enchant-dev freetds-dev freetype-dev gdbm-dev gettext-dev gmp-dev icu-dev imagemagick-dev imap-dev jpeg-dev krb5-dev libarchive libcurl libintl libressl2.6-libcrypto libc-dev libedit-dev libical-dev libjpeg-turbo-dev libmcrypt-dev libpng-dev libressl-dev libsodium-dev libssh2-dev libwebp-dev libxml2-dev libxpm-dev libxslt-dev libzip-dev musl-dev net-snmp-dev openldap-dev pcre-dev postgresql-dev readline-dev recode-dev sqlite-dev tidyhtml-dev unixodbc-dev zlib-dev"
BUILD_DEPS="${BUILD_BINS} ${BUILD_LIBS}"

PERSIST_DEPS="bash sudo wget curl gnupg openssl shadow pcre ca-certificates tar xz"
PERSIST_DEPS="bash sudo wget curl gnupg openssl shadow pcre ca-certificates tar xz imagemagick"

BUILDDIR="/build"
PHPDIR="${BUILDDIR}/php-${PACKAGE_VERSION}"

CFLAGS="-fstack-protector-strong -fpic -fpie -O2"; export CFLAGS
Expand Down Expand Up @@ -60,6 +59,7 @@ cd ${BUILDDIR}; checkExit
patch -p0 < install-pear.patch; checkExit
# patch -p0 < libressl-2.7.patch; checkExit
patch -p0 < allow-build-recode-and-imap-together.patch; checkExit
ln /usr/include/tidybuffio.h /usr/include/buffio.h


echo "# WPLib Box: Configure PHP ${PACKAGE_VERSION}."
Expand Down Expand Up @@ -193,6 +193,28 @@ make; checkExit
make install; checkExit


echo "# WPLib Box: Adding mcrypt extension, (1.0.1)."
cd ${PHPDIR}/ext; checkExit
wget -nv http://pecl.php.net/get/mcrypt-1.0.1.tgz; checkExit
tar zxf mcrypt-1.0.1.tgz; checkExit
cd mcrypt-1.0.1; checkExit
phpize; checkExit
./configure; checkExit
make; checkExit
make install; checkExit


echo "# WPLib Box: Adding ssh2 extension, (1.1.2)."
cd ${PHPDIR}/ext; checkExit
wget -nv http://pecl.php.net/get/ssh2-1.1.2.tgz; checkExit
tar zxf ssh2-1.1.2.tgz; checkExit
cd ssh2-1.1.2; checkExit
phpize; checkExit
./configure; checkExit
make; checkExit
make install; checkExit


echo "# WPLib Box: pecl update-channels."
# Fixup pecl errors.
# EG: "Warning: Invalid argument supplied for foreach() in /usr/share/pear/PEAR/Command.php
Expand Down
3 changes: 2 additions & 1 deletion template/build/cleanup.sh
@@ -1,5 +1,6 @@
#!/bin/sh

BUILDDIR="/build"

checkExit()
{
Expand Down Expand Up @@ -33,5 +34,5 @@ echo "# WPLib Box: Cleaning up."
rm -rf ${BUILDDIR}
unset BUILD_DEPS PERSIST_DEPS RUNTIME_DEPS CPPFLAGS LDFLAGS CFLAGS EXTENSION_DIR

apk add alpine-baselayout alpine-keys apk-tools libc-utils bash less
# apk add alpine-baselayout alpine-keys apk-tools libc-utils bash less

2 changes: 1 addition & 1 deletion template/build/install-pear.patch
@@ -1,5 +1,5 @@
--- ./pear/Makefile.frag.orig 2013-04-12 07:02:27.041602514 +0000
+++ php-7.2.6/pear/Makefile.frag 2013-04-12 07:04:09.065836822 +0000
+++ php-%%VERSION%%/pear/Makefile.frag 2013-04-12 07:04:09.065836822 +0000
@@ -2,8 +2,11 @@

peardir=$(PEAR_INSTALLDIR)
Expand Down
4 changes: 2 additions & 2 deletions template/build/libressl-2.7.patch
@@ -1,7 +1,7 @@
diff --git a/ext/openssl/openssl.c php-7.2.6/ext/openssl/openssl.c
diff --git a/ext/openssl/openssl.c php-%%VERSION%%/ext/openssl/openssl.c
index 524192a..9c126a2 100644
--- a/ext/openssl/openssl.c
+++ php-7.2.6/ext/openssl/openssl.c
+++ php-%%VERSION%%/ext/openssl/openssl.c
@@ -566,7 +566,7 @@ ZEND_GET_MODULE(openssl)
#endif

Expand Down
1 change: 1 addition & 0 deletions template/files/etc/php/conf.d/fileinfo.ini
@@ -0,0 +1 @@
extension=fileinfo.so
1 change: 1 addition & 0 deletions template/files/etc/php/conf.d/mysqlnd.ini
@@ -1 +1,2 @@
extension=mysqlnd.so
extension=mysqli.so
1 change: 1 addition & 0 deletions template/files/etc/php/conf.d/simplexml.ini
@@ -0,0 +1 @@
extension=simplexml.so
1 change: 1 addition & 0 deletions template/files/etc/php/conf.d/sodium.ini
@@ -0,0 +1 @@
extension=sodium.so
1 change: 1 addition & 0 deletions template/files/etc/php/conf.d/ssh2.ini
@@ -0,0 +1 @@
extension=ssh2.so
1 change: 1 addition & 0 deletions template/files/etc/php/conf.d/zlib.ini
@@ -0,0 +1 @@
;extension=zlib.so

0 comments on commit c60019f

Please sign in to comment.