Skip to content

Commit

Permalink
Add Composer to the PHP image (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
pento authored Aug 14, 2019
1 parent 3e72a6d commit 133e890
Show file tree
Hide file tree
Showing 13 changed files with 254 additions and 30 deletions.
3 changes: 3 additions & 0 deletions 5.2/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ WORKDIR /var/www
#
#

ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /tmp



COPY entrypoint.sh /entrypoint.sh
Expand Down
25 changes: 24 additions & 1 deletion 5.3/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,30 @@ WORKDIR /var/www
#
#


ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /tmp

# install the PHP extensions we need
RUN set -ex; \
\
apt-get update; \
\
apt-get install -y --no-install-recommends unzip; \
\
curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \
curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \
php -r " \
\$signature = file_get_contents( '/tmp/installer.sig' ); \
\$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \
if ( \$signature !== \$hash ) { \
unlink( '/tmp/installer.php' ); \
unlink( '/tmp/installer.sig' ); \
echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \
exit( 1 ); \
}"; \
php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \
composer --ansi --version --no-interaction; \
rm -f /tmp/installer.php /tmp/installer.sig;

COPY entrypoint.sh /entrypoint.sh

Expand Down
22 changes: 20 additions & 2 deletions 5.4/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,37 @@ WORKDIR /var/www
#
#

ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /tmp

# install the PHP extensions we need
RUN set -ex; \
\
apt-get update; \
\
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libzip-dev libmemcached-dev; \
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libzip-dev libmemcached-dev unzip; \
\
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
\
docker-php-ext-install gd mysql mysqli zip; \
\
pecl install xdebug-2.4.1; \
pecl install memcached-2.2.0;
pecl install memcached-2.2.0; \
\
curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \
curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \
php -r " \
\$signature = file_get_contents( '/tmp/installer.sig' ); \
\$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \
if ( \$signature !== \$hash ) { \
unlink( '/tmp/installer.php' ); \
unlink( '/tmp/installer.sig' ); \
echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \
exit( 1 ); \
}"; \
php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \
composer --ansi --version --no-interaction; \
rm -f /tmp/installer.php /tmp/installer.sig;

COPY entrypoint.sh /entrypoint.sh

Expand Down
22 changes: 20 additions & 2 deletions 5.5/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,37 @@ WORKDIR /var/www
#
#

ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /tmp

# install the PHP extensions we need
RUN set -ex; \
\
apt-get update; \
\
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libzip-dev libmemcached-dev; \
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libzip-dev libmemcached-dev unzip; \
\
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
\
docker-php-ext-install gd mysql mysqli zip; \
\
pecl install xdebug-2.5.5; \
pecl install memcached-2.2.0;
pecl install memcached-2.2.0; \
\
curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \
curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \
php -r " \
\$signature = file_get_contents( '/tmp/installer.sig' ); \
\$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \
if ( \$signature !== \$hash ) { \
unlink( '/tmp/installer.php' ); \
unlink( '/tmp/installer.sig' ); \
echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \
exit( 1 ); \
}"; \
php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \
composer --ansi --version --no-interaction; \
rm -f /tmp/installer.php /tmp/installer.sig;

COPY entrypoint.sh /entrypoint.sh

Expand Down
22 changes: 20 additions & 2 deletions 5.6/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,37 @@ WORKDIR /var/www
#
#

ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /tmp

# install the PHP extensions we need
RUN set -ex; \
\
apt-get update; \
\
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libzip-dev libmemcached-dev; \
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libzip-dev libmemcached-dev unzip; \
\
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
\
docker-php-ext-install gd mysql mysqli zip; \
\
pecl install xdebug-2.5.5; \
pecl install memcached-2.2.0;
pecl install memcached-2.2.0; \
\
curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \
curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \
php -r " \
\$signature = file_get_contents( '/tmp/installer.sig' ); \
\$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \
if ( \$signature !== \$hash ) { \
unlink( '/tmp/installer.php' ); \
unlink( '/tmp/installer.sig' ); \
echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \
exit( 1 ); \
}"; \
php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \
composer --ansi --version --no-interaction; \
rm -f /tmp/installer.php /tmp/installer.sig;

COPY entrypoint.sh /entrypoint.sh

Expand Down
22 changes: 20 additions & 2 deletions 7.0/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,37 @@ WORKDIR /var/www
#
#

ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /tmp

# install the PHP extensions we need
RUN set -ex; \
\
apt-get update; \
\
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libzip-dev libmemcached-dev; \
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libzip-dev libmemcached-dev unzip; \
\
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
\
docker-php-ext-install gd opcache mysqli zip; \
\
pecl install xdebug-2.7.2; \
pecl install memcached-3.1.3;
pecl install memcached-3.1.3; \
\
curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \
curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \
php -r " \
\$signature = file_get_contents( '/tmp/installer.sig' ); \
\$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \
if ( \$signature !== \$hash ) { \
unlink( '/tmp/installer.php' ); \
unlink( '/tmp/installer.sig' ); \
echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \
exit( 1 ); \
}"; \
php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \
composer --ansi --version --no-interaction; \
rm -f /tmp/installer.php /tmp/installer.sig;

COPY entrypoint.sh /entrypoint.sh

Expand Down
22 changes: 20 additions & 2 deletions 7.1/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,37 @@ WORKDIR /var/www
#
#

ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /tmp

# install the PHP extensions we need
RUN set -ex; \
\
apt-get update; \
\
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libzip-dev libmemcached-dev; \
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libzip-dev libmemcached-dev unzip; \
\
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
\
docker-php-ext-install gd opcache mysqli zip; \
\
pecl install xdebug-2.7.2; \
pecl install memcached-3.1.3;
pecl install memcached-3.1.3; \
\
curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \
curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \
php -r " \
\$signature = file_get_contents( '/tmp/installer.sig' ); \
\$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \
if ( \$signature !== \$hash ) { \
unlink( '/tmp/installer.php' ); \
unlink( '/tmp/installer.sig' ); \
echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \
exit( 1 ); \
}"; \
php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \
composer --ansi --version --no-interaction; \
rm -f /tmp/installer.php /tmp/installer.sig;

COPY entrypoint.sh /entrypoint.sh

Expand Down
22 changes: 20 additions & 2 deletions 7.2/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,37 @@ WORKDIR /var/www
#
#

ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /tmp

# install the PHP extensions we need
RUN set -ex; \
\
apt-get update; \
\
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libzip-dev libmemcached-dev; \
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libzip-dev libmemcached-dev unzip; \
\
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
\
docker-php-ext-install gd opcache mysqli zip; \
\
pecl install xdebug-2.7.2; \
pecl install memcached-3.1.3;
pecl install memcached-3.1.3; \
\
curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \
curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \
php -r " \
\$signature = file_get_contents( '/tmp/installer.sig' ); \
\$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \
if ( \$signature !== \$hash ) { \
unlink( '/tmp/installer.php' ); \
unlink( '/tmp/installer.sig' ); \
echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \
exit( 1 ); \
}"; \
php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \
composer --ansi --version --no-interaction; \
rm -f /tmp/installer.php /tmp/installer.sig;

COPY entrypoint.sh /entrypoint.sh

Expand Down
22 changes: 20 additions & 2 deletions 7.3/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,37 @@ WORKDIR /var/www
#
#

ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /tmp

# install the PHP extensions we need
RUN set -ex; \
\
apt-get update; \
\
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libzip-dev libmemcached-dev; \
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libzip-dev libmemcached-dev unzip; \
\
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
\
docker-php-ext-install gd opcache mysqli zip; \
\
pecl install xdebug-2.7.2; \
pecl install memcached-3.1.3;
pecl install memcached-3.1.3; \
\
curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \
curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \
php -r " \
\$signature = file_get_contents( '/tmp/installer.sig' ); \
\$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \
if ( \$signature !== \$hash ) { \
unlink( '/tmp/installer.php' ); \
unlink( '/tmp/installer.sig' ); \
echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \
exit( 1 ); \
}"; \
php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \
composer --ansi --version --no-interaction; \
rm -f /tmp/installer.php /tmp/installer.sig;

COPY entrypoint.sh /entrypoint.sh

Expand Down
22 changes: 20 additions & 2 deletions 7.4/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,37 @@ WORKDIR /var/www
#
#

ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /tmp

# install the PHP extensions we need
RUN set -ex; \
\
apt-get update; \
\
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libzip-dev libmemcached-dev; \
apt-get install -y --no-install-recommends libjpeg-dev libpng-dev libzip-dev libmemcached-dev unzip; \
\
docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr; \
\
docker-php-ext-install gd opcache mysqli zip; \
\
pecl install xdebug-2.8.0beta1; \
pecl install memcached-3.1.3;
pecl install memcached-3.1.3; \
\
curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \
curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \
php -r " \
\$signature = file_get_contents( '/tmp/installer.sig' ); \
\$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \
if ( \$signature !== \$hash ) { \
unlink( '/tmp/installer.php' ); \
unlink( '/tmp/installer.sig' ); \
echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \
exit( 1 ); \
}"; \
php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \
composer --ansi --version --no-interaction; \
rm -f /tmp/installer.php /tmp/installer.sig;

COPY entrypoint.sh /entrypoint.sh

Expand Down
24 changes: 23 additions & 1 deletion 8.0/php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,32 @@ WORKDIR /var/www
#
#

ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /tmp

# install the PHP extensions we need
RUN set -ex; \
\
docker-php-ext-install mysqli;
apt-get update; \
\
apt-get install -y --no-install-recommends unzip; \
\
docker-php-ext-install mysqli; \
\
curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://getcomposer.org/installer; \
curl --silent --fail --location --retry 3 --output /tmp/installer.sig --url https://composer.github.io/installer.sig; \
php -r " \
\$signature = file_get_contents( '/tmp/installer.sig' ); \
\$hash = hash( 'sha384', file_get_contents('/tmp/installer.php') ); \
if ( \$signature !== \$hash ) { \
unlink( '/tmp/installer.php' ); \
unlink( '/tmp/installer.sig' ); \
echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \
exit( 1 ); \
}"; \
php /tmp/installer.php --no-ansi --install-dir=/usr/bin --filename=composer; \
composer --ansi --version --no-interaction; \
rm -f /tmp/installer.php /tmp/installer.sig;

COPY entrypoint.sh /entrypoint.sh

Expand Down
Loading

0 comments on commit 133e890

Please sign in to comment.