From 9820952cbcb44f6fce9aeee1f4cab490f0fc2f9f Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Thu, 15 Oct 2020 18:03:02 +0200 Subject: [PATCH] Clean up php composer installation --- entrypoint.sh.tmpl | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/entrypoint.sh.tmpl b/entrypoint.sh.tmpl index 72f9b51..cf804d6 100755 --- a/entrypoint.sh.tmpl +++ b/entrypoint.sh.tmpl @@ -6,17 +6,13 @@ init_db() { set -eu if ! type mysql > /dev/null 2>&1; then - apt update && apt install -y \ - curl \ - git \ - mariadb-client \ - php-cli \ - unzip + apt update && apt install -y mariadb-client + fi - curl -sS https://getcomposer.org/installer -o composer-setup.php - export HASH="a69df12e86a0a18fbedfc91a33d5f9acc5cf939576e0258326074fc1b2ee1aea" - php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Composer installer verified'; } else { echo 'Composer installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" - php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.15 + if ! type composer > /dev/null 2>&1; then + apt update && apt install -y curl git unzip + curl -sS https://getcomposer.org/installer -o /tmp/composer-setup.php + php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=1.10.15 composer -V fi