add composer install hash verification

This commit is contained in:
Aaron Welch
2016-07-06 13:20:44 -04:00
parent 4798c022b2
commit eb83d544bc

View File

@@ -4,6 +4,7 @@ MAINTAINER ngineered <support@ngineered.co.uk>
ENV php_conf /etc/php5/php.ini ENV php_conf /etc/php5/php.ini
ENV fpm_conf /etc/php5/php-fpm.conf ENV fpm_conf /etc/php5/php-fpm.conf
ENV composer_hash e115a8dc7871f15d853148a7fbac7da27d6c0030b848d9b3dc09e2a0388afed865e6a3d6b3c0fad45c48e2b5fc1196ae
RUN apk add --no-cache bash \ RUN apk add --no-cache bash \
openssh-client \ openssh-client \
@@ -34,12 +35,16 @@ RUN apk add --no-cache bash \
php5-phar \ php5-phar \
php5-soap \ php5-soap \
php5-dom && \ php5-dom && \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer && \
mkdir -p /etc/nginx && \ mkdir -p /etc/nginx && \
mkdir -p /var/www/app && \ mkdir -p /var/www/app && \
mkdir -p /run/nginx && \ mkdir -p /run/nginx && \
mkdir -p /var/log/supervisor mkdir -p /var/log/supervisor
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
php -r "if (hash_file('SHA384', 'composer-setup.php') === '${composer_hash}') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && \
php composer-setup.php --install-dir=/usr/bin --filename=composer && \
php -r "unlink('composer-setup.php');"
ADD conf/supervisord.conf /etc/supervisord.conf ADD conf/supervisord.conf /etc/supervisord.conf
# Copy our nginx config # Copy our nginx config