#315 fixed docker compose error and switched to PHP 7.2.0

This commit is contained in:
Dominik Liebler
2017-12-27 08:48:20 +01:00
parent 7cb5aa618b
commit 2141c4916c
3 changed files with 24 additions and 10 deletions

7
Dockerfile Normal file
View File

@@ -0,0 +1,7 @@
FROM php:7.2.0-cli
WORKDIR /opt/php
RUN apt-get update \
&& apt-get install -y zlib1g-dev wget git-core \
&& docker-php-ext-install zip
ADD . /opt/php
CMD [ "./docker/test_runner.sh" ]

View File

@@ -1,9 +1,9 @@
version: "3.1" version: "3.1"
services: services:
php: php:
image: php:7.1.7-cli build:
context: .
dockerfile: Dockerfile
volumes: volumes:
- .:/opt/php - .:/opt/php
privileged: true command: ["/opt/php/docker/test_runner.sh"]
command: ["/opt/php/docker/test_runner.sh"]

View File

@@ -1,12 +1,19 @@
#!/usr/bin/env bash #!/bin/sh
cd /opt/php
echo "Installing composer..." echo "Installing composer..."
EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")
php composer-setup.php
php -r "unlink('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 --quiet
rm composer-setup.php
echo "Downloading dependencies using composer..." echo "Downloading dependencies using composer..."
php composer.phar install --prefer-dist --no-interaction php composer.phar install --prefer-dist --no-interaction