diff --git a/5.6/apache/Dockerfile b/5.6/apache/Dockerfile index e3b2774..aa0d6ed 100644 --- a/5.6/apache/Dockerfile +++ b/5.6/apache/Dockerfile @@ -16,3 +16,7 @@ RUN apt-get update \ # Cleanup to keep the images size small && apt-get autoremove -y \ && rm -r /var/lib/apt/lists/* + +# Install composer +COPY install-composer /install-composer +RUN /install-composer && rm /install-composer diff --git a/5.6/apache/install-composer b/5.6/apache/install-composer new file mode 100755 index 0000000..f7d34be --- /dev/null +++ b/5.6/apache/install-composer @@ -0,0 +1,17 @@ +#!/bin/sh + +EXPECTED_SIGNATURE=$(curl https://composer.github.io/installer.sig) +php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" +ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');") + +if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] +then + >&2 echo 'ERROR: Invalid installer signature' + rm composer-setup.php + exit 1 +fi + +php composer-setup.php --install-dir=/usr/bin --filename=composer +RESULT=$? +rm composer-setup.php +exit $RESULT diff --git a/5.6/fpm/Dockerfile b/5.6/fpm/Dockerfile index 3491022..645ae1a 100644 --- a/5.6/fpm/Dockerfile +++ b/5.6/fpm/Dockerfile @@ -16,3 +16,7 @@ RUN apt-get update \ # Cleanup to keep the images size small && apt-get autoremove -y \ && rm -r /var/lib/apt/lists/* + +# Install composer +COPY install-composer /install-composer +RUN /install-composer && rm /install-composer diff --git a/5.6/fpm/install-composer b/5.6/fpm/install-composer new file mode 100755 index 0000000..f7d34be --- /dev/null +++ b/5.6/fpm/install-composer @@ -0,0 +1,17 @@ +#!/bin/sh + +EXPECTED_SIGNATURE=$(curl https://composer.github.io/installer.sig) +php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" +ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');") + +if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] +then + >&2 echo 'ERROR: Invalid installer signature' + rm composer-setup.php + exit 1 +fi + +php composer-setup.php --install-dir=/usr/bin --filename=composer +RESULT=$? +rm composer-setup.php +exit $RESULT diff --git a/7.0/apache/Dockerfile b/7.0/apache/Dockerfile index 02f507d..c24e185 100644 --- a/7.0/apache/Dockerfile +++ b/7.0/apache/Dockerfile @@ -16,3 +16,7 @@ RUN apt-get update \ # Cleanup to keep the images size small && apt-get autoremove -y \ && rm -r /var/lib/apt/lists/* + +# Install composer +COPY install-composer /install-composer +RUN /install-composer && rm /install-composer diff --git a/7.0/apache/install-composer b/7.0/apache/install-composer new file mode 100755 index 0000000..f7d34be --- /dev/null +++ b/7.0/apache/install-composer @@ -0,0 +1,17 @@ +#!/bin/sh + +EXPECTED_SIGNATURE=$(curl https://composer.github.io/installer.sig) +php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" +ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');") + +if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] +then + >&2 echo 'ERROR: Invalid installer signature' + rm composer-setup.php + exit 1 +fi + +php composer-setup.php --install-dir=/usr/bin --filename=composer +RESULT=$? +rm composer-setup.php +exit $RESULT diff --git a/7.0/fpm/Dockerfile b/7.0/fpm/Dockerfile index 437f6c9..503fc41 100644 --- a/7.0/fpm/Dockerfile +++ b/7.0/fpm/Dockerfile @@ -16,3 +16,7 @@ RUN apt-get update \ # Cleanup to keep the images size small && apt-get autoremove -y \ && rm -r /var/lib/apt/lists/* + +# Install composer +COPY install-composer /install-composer +RUN /install-composer && rm /install-composer diff --git a/7.0/fpm/install-composer b/7.0/fpm/install-composer new file mode 100755 index 0000000..f7d34be --- /dev/null +++ b/7.0/fpm/install-composer @@ -0,0 +1,17 @@ +#!/bin/sh + +EXPECTED_SIGNATURE=$(curl https://composer.github.io/installer.sig) +php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" +ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');") + +if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] +then + >&2 echo 'ERROR: Invalid installer signature' + rm composer-setup.php + exit 1 +fi + +php composer-setup.php --install-dir=/usr/bin --filename=composer +RESULT=$? +rm composer-setup.php +exit $RESULT diff --git a/7.1/apache/Dockerfile b/7.1/apache/Dockerfile index fb4979d..5377a59 100644 --- a/7.1/apache/Dockerfile +++ b/7.1/apache/Dockerfile @@ -16,3 +16,7 @@ RUN apt-get update \ # Cleanup to keep the images size small && apt-get autoremove -y \ && rm -r /var/lib/apt/lists/* + +# Install composer +COPY install-composer /install-composer +RUN /install-composer && rm /install-composer diff --git a/7.1/apache/install-composer b/7.1/apache/install-composer new file mode 100755 index 0000000..f7d34be --- /dev/null +++ b/7.1/apache/install-composer @@ -0,0 +1,17 @@ +#!/bin/sh + +EXPECTED_SIGNATURE=$(curl https://composer.github.io/installer.sig) +php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" +ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');") + +if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] +then + >&2 echo 'ERROR: Invalid installer signature' + rm composer-setup.php + exit 1 +fi + +php composer-setup.php --install-dir=/usr/bin --filename=composer +RESULT=$? +rm composer-setup.php +exit $RESULT diff --git a/7.1/fpm/Dockerfile b/7.1/fpm/Dockerfile index 0b7ac12..84a8fe5 100644 --- a/7.1/fpm/Dockerfile +++ b/7.1/fpm/Dockerfile @@ -16,3 +16,7 @@ RUN apt-get update \ # Cleanup to keep the images size small && apt-get autoremove -y \ && rm -r /var/lib/apt/lists/* + +# Install composer +COPY install-composer /install-composer +RUN /install-composer && rm /install-composer diff --git a/7.1/fpm/install-composer b/7.1/fpm/install-composer new file mode 100755 index 0000000..f7d34be --- /dev/null +++ b/7.1/fpm/install-composer @@ -0,0 +1,17 @@ +#!/bin/sh + +EXPECTED_SIGNATURE=$(curl https://composer.github.io/installer.sig) +php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" +ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');") + +if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ] +then + >&2 echo 'ERROR: Invalid installer signature' + rm composer-setup.php + exit 1 +fi + +php composer-setup.php --install-dir=/usr/bin --filename=composer +RESULT=$? +rm composer-setup.php +exit $RESULT