Skip to content

Commit

Permalink
Update composer to 1.8.0 and fix sha384 hash calculation
Browse files Browse the repository at this point in the history
Fixes docker building - looks like SHA384 was renamed to sha384 on more recent OpenSSL versions.
  • Loading branch information
aj-gh authored and andygrunwald committed Jan 29, 2019
1 parent a734ba2 commit c1cdac3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Dockerfile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ RUN apt-get update \
libjpeg62-turbo-dev \ libjpeg62-turbo-dev \
libsnmp-dev \ libsnmp-dev \
snmp \ snmp \
unzip \
&& docker-php-ext-install -j$(nproc) mysqli snmp \ && docker-php-ext-install -j$(nproc) mysqli snmp \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd \ && docker-php-ext-install -j$(nproc) gd \
Expand All @@ -23,16 +24,18 @@ RUN apt-get update \


# Composer setup starts here. The zip extension is required for that. # Composer setup starts here. The zip extension is required for that.
# See https://github.com/composer/docker/blob/8a2a40c3376bac96f8e3db2f129062173bff7734/1.6/Dockerfile # See https://github.com/composer/docker/blob/8a2a40c3376bac96f8e3db2f129062173bff7734/1.6/Dockerfile
# and https://github.com/composer/docker/blob/942dac53831e7b4ca4419a135304e177b9d29dbd/1.8/Dockerfile
# or more recently https://getcomposer.org/download/
RUN docker-php-ext-install zip RUN docker-php-ext-install zip


ENV COMPOSER_ALLOW_SUPERUSER 1 ENV COMPOSER_ALLOW_SUPERUSER 1
ENV COMPOSER_HOME /tmp ENV COMPOSER_HOME /tmp
ENV COMPOSER_VERSION 1.6.2 ENV COMPOSER_VERSION 1.8.0


RUN curl -s -f -L -o /tmp/installer.php https://raw.githubusercontent.com/composer/getcomposer.org/b107d959a5924af895807021fcef4ffec5a76aa9/web/installer \ RUN curl --silent --fail --location --retry 3 --output /tmp/installer.php --url https://raw.githubusercontent.com/composer/getcomposer.org/d3e09029468023aa4e9dcd165e9b6f43df0a9999/web/installer \
&& php -r " \ && php -r " \
\$signature = '544e09ee996cdf60ece3804abc52599c22b1f40f4323403c44d44fdfdd586475ca9813a858088ffbc1f233e9b180f061'; \ \$signature = '93b54496392c062774670ac18b134c3b3a95e5a5e5c8f1a9f115f203b75bf9a129d5daa8ba6a13e2cc8a1da0806388a8'; \
\$hash = hash('SHA384', file_get_contents('/tmp/installer.php')); \ \$hash = hash_file('sha384', '/tmp/installer.php'); \
if (!hash_equals(\$signature, \$hash)) { \ if (!hash_equals(\$signature, \$hash)) { \
unlink('/tmp/installer.php'); \ unlink('/tmp/installer.php'); \
echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \ echo 'Integrity check failed, installer is either corrupt or worse.' . PHP_EOL; \
Expand Down

0 comments on commit c1cdac3

Please sign in to comment.