Skip to content

Commit

Permalink
Merge pull request #271 from hhoechtl/ioncube
Browse files Browse the repository at this point in the history
[TASK] add ioncube to all php images
  • Loading branch information
htuscher committed Oct 8, 2018
2 parents 1217f1a + b75cc15 commit ac9d001
Show file tree
Hide file tree
Showing 72 changed files with 1,225 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docker/php-apache-dev/centos-7-php7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ RUN set -x \
php70w-pecl-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-apache-dev/debian-8-php7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ RUN set -x \
php7.0-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-apache-dev/debian-9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ RUN set -x \
php-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-apache-dev/ubuntu-16.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ RUN set -x \
php-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-apache-dev/ubuntu-16.10/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ RUN set -x \
php-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-apache-dev/ubuntu-17.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ RUN set -x \
php-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-apache-dev/ubuntu-17.10/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ RUN set -x \
php-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-apache-dev/ubuntu-18.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ RUN set -x \
php-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-dev/centos-7-php7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ RUN set -x \
php70w-pecl-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-dev/debian-8-php7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ RUN set -x \
php7.0-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-dev/debian-9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ RUN set -x \
php-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-dev/ubuntu-16.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ RUN set -x \
php-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-dev/ubuntu-16.10/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ RUN set -x \
php-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-dev/ubuntu-17.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ RUN set -x \
php-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-dev/ubuntu-17.10/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ RUN set -x \
php-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-dev/ubuntu-18.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ RUN set -x \
php-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-nginx-dev/centos-7-php7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ RUN set -x \
php70w-pecl-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-nginx-dev/debian-8-php7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ RUN set -x \
php7.0-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-nginx-dev/debian-9/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ RUN set -x \
php-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-nginx-dev/ubuntu-16.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ RUN set -x \
php-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-nginx-dev/ubuntu-16.10/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ RUN set -x \
php-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-nginx-dev/ubuntu-17.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ RUN set -x \
php-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-nginx-dev/ubuntu-17.10/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ RUN set -x \
php-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
3 changes: 3 additions & 0 deletions docker/php-nginx-dev/ubuntu-18.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ RUN set -x \
php-xdebug \
blackfire-php \
blackfire-agent \
# Tools
nano \
vim \
# Enable php development services
&& docker-service enable syslog \
&& docker-service enable postfix \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ PHP_MAIN_CONF=/usr/local/etc/php-fpm.conf
PHP_POOL_CONF=www.conf
PHP_POOL_DIR=/usr/local/etc/php-fpm.d
PHP_FPM_BIN=/usr/local/sbin/php-fpm
PHP_MOD_INI_DIR=/usr/local/etc/php/conf.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash

echo "Installing ionCube loader"

DOWNLOAD_URL="http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz"
TMP_FILE="/tmp/ioncube_loaders.tar.gz"

echo "Downloading ..."
curl -sS ${DOWNLOAD_URL} -o ${TMP_FILE}
echo "Unpacking ..."
tar -xzf ${TMP_FILE} -C /tmp

PHP_VERSION=`php -v | head -1 | grep -o 'PHP [0-9].[0-9]' | sed -r 's/PHP //g'`
PHP_EXTENSION_DIR=`php -i | grep -o -m 1 'extension_dir .* =' | sed -r 's/extension_dir => //g' | sed -r 's/ =//g'`
MOD_INI="${PHP_MOD_INI_DIR}/00-ioncube.ini"
SO_FILE="${PHP_EXTENSION_DIR}/ioncube_loader_lin_${PHP_VERSION}.so"

echo "PHP-VERSION: ${PHP_VERSION}"
echo "PHP-EXTENSION-DIR: ${PHP_EXTENSION_DIR}"
echo "Installing ${SO_FILE}"
cp "/tmp/ioncube/ioncube_loader_lin_${PHP_VERSION}.so" ${SO_FILE}

echo "Writing module ini"
echo "[ioncube]" > ${MOD_INI}
echo "zend_extension = ${SO_FILE}" >> ${MOD_INI}
echo "; priority=01" >> ${MOD_INI}

echo "Cleaning up"
rm -rf $TMP_FILE
rm -rf /tmp/ioncube

echo "Enabling ionCube PHP module"
case "$IMAGE_FAMILY" in
Debian|Ubuntu)
# Enable ionCube (if available)
if [[ -f "${PHP_ETC_DIR}/mods-available/00-ioncube.ini" ]]; then
ln -sf "${PHP_ETC_DIR}/mods-available/00-ioncube.ini" "${PHP_ETC_DIR}/cli/conf.d/00-ioncube.ini"
ln -sf "${PHP_ETC_DIR}/mods-available/00-ioncube.ini" "${PHP_ETC_DIR}/fpm/conf.d/00-ioncube.ini"
fi
;;
esac
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ PHP_MAIN_CONF=/usr/local/etc/php-fpm.conf
PHP_POOL_CONF=www.conf
PHP_POOL_DIR=/usr/local/etc/php-fpm.d
PHP_FPM_BIN=/usr/local/sbin/php-fpm
PHP_MOD_INI_DIR=/usr/local/etc/php/conf.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash

echo "Installing ionCube loader"

DOWNLOAD_URL="http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz"
TMP_FILE="/tmp/ioncube_loaders.tar.gz"

echo "Downloading ..."
curl -sS ${DOWNLOAD_URL} -o ${TMP_FILE}
echo "Unpacking ..."
tar -xzf ${TMP_FILE} -C /tmp

PHP_VERSION=`php -v | head -1 | grep -o 'PHP [0-9].[0-9]' | sed -r 's/PHP //g'`
PHP_EXTENSION_DIR=`php -i | grep -o -m 1 'extension_dir .* =' | sed -r 's/extension_dir => //g' | sed -r 's/ =//g'`
MOD_INI="${PHP_MOD_INI_DIR}/00-ioncube.ini"
SO_FILE="${PHP_EXTENSION_DIR}/ioncube_loader_lin_${PHP_VERSION}.so"

echo "PHP-VERSION: ${PHP_VERSION}"
echo "PHP-EXTENSION-DIR: ${PHP_EXTENSION_DIR}"
echo "Installing ${SO_FILE}"
cp "/tmp/ioncube/ioncube_loader_lin_${PHP_VERSION}.so" ${SO_FILE}

echo "Writing module ini"
echo "[ioncube]" > ${MOD_INI}
echo "zend_extension = ${SO_FILE}" >> ${MOD_INI}
echo "; priority=01" >> ${MOD_INI}

echo "Cleaning up"
rm -rf $TMP_FILE
rm -rf /tmp/ioncube

echo "Enabling ionCube PHP module"
case "$IMAGE_FAMILY" in
Debian|Ubuntu)
# Enable ionCube (if available)
if [[ -f "${PHP_ETC_DIR}/mods-available/00-ioncube.ini" ]]; then
ln -sf "${PHP_ETC_DIR}/mods-available/00-ioncube.ini" "${PHP_ETC_DIR}/cli/conf.d/00-ioncube.ini"
ln -sf "${PHP_ETC_DIR}/mods-available/00-ioncube.ini" "${PHP_ETC_DIR}/fpm/conf.d/00-ioncube.ini"
fi
;;
esac
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ PHP_MAIN_CONF=/usr/local/etc/php-fpm.conf
PHP_POOL_CONF=www.conf
PHP_POOL_DIR=/usr/local/etc/php-fpm.d
PHP_FPM_BIN=/usr/local/sbin/php-fpm
PHP_MOD_INI_DIR=/usr/local/etc/php/conf.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/env bash

echo "Installing ionCube loader"

DOWNLOAD_URL="http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz"
TMP_FILE="/tmp/ioncube_loaders.tar.gz"

echo "Downloading ..."
curl -sS ${DOWNLOAD_URL} -o ${TMP_FILE}
echo "Unpacking ..."
tar -xzf ${TMP_FILE} -C /tmp

PHP_VERSION=`php -v | head -1 | grep -o 'PHP [0-9].[0-9]' | sed -r 's/PHP //g'`
PHP_EXTENSION_DIR=`php -i | grep -o -m 1 'extension_dir .* =' | sed -r 's/extension_dir => //g' | sed -r 's/ =//g'`
MOD_INI="${PHP_MOD_INI_DIR}/00-ioncube.ini"
SO_FILE="${PHP_EXTENSION_DIR}/ioncube_loader_lin_${PHP_VERSION}.so"

echo "PHP-VERSION: ${PHP_VERSION}"
echo "PHP-EXTENSION-DIR: ${PHP_EXTENSION_DIR}"
echo "Installing ${SO_FILE}"
cp "/tmp/ioncube/ioncube_loader_lin_${PHP_VERSION}.so" ${SO_FILE}

echo "Writing module ini"
echo "[ioncube]" > ${MOD_INI}
echo "zend_extension = ${SO_FILE}" >> ${MOD_INI}
echo "; priority=01" >> ${MOD_INI}

echo "Cleaning up"
rm -rf $TMP_FILE
rm -rf /tmp/ioncube

echo "Enabling ionCube PHP module"
case "$IMAGE_FAMILY" in
Debian|Ubuntu)
# Enable ionCube (if available)
if [[ -f "${PHP_ETC_DIR}/mods-available/00-ioncube.ini" ]]; then
ln -sf "${PHP_ETC_DIR}/mods-available/00-ioncube.ini" "${PHP_ETC_DIR}/cli/conf.d/00-ioncube.ini"
ln -sf "${PHP_ETC_DIR}/mods-available/00-ioncube.ini" "${PHP_ETC_DIR}/fpm/conf.d/00-ioncube.ini"
fi
;;
esac
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ PHP_MAIN_CONF=/usr/local/etc/php-fpm.conf
PHP_POOL_CONF=www.conf
PHP_POOL_DIR=/usr/local/etc/php-fpm.d
PHP_FPM_BIN=/usr/local/sbin/php-fpm
PHP_MOD_INI_DIR=/usr/local/etc/php/conf.d

0 comments on commit ac9d001

Please sign in to comment.