From 1630ae57f3dd345edeb3d5164f43e2db55b5b7c9 Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Fri, 12 Jan 2018 12:01:32 +0000 Subject: [PATCH] Copy composer from the official image --- Dockerfile | 2 +- Dockerfile-alpine | 2 +- install-composer.sh | 18 ------------------ tools.php | 2 +- 4 files changed, 3 insertions(+), 21 deletions(-) delete mode 100755 install-composer.sh diff --git a/Dockerfile b/Dockerfile index 9fe41988..c6a05f41 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ ENV TOOLS_JSON=/root/tools.json COPY tools.json ${TOOLS_JSON} COPY tools.php /usr/local/bin/tools.php -COPY install-composer.sh /usr/local/bin/install-composer.sh +COPY --from=composer:1.6 /usr/bin/composer /usr/bin/composer RUN apt-get update && apt-get install -y --no-install-recommends $TOOL_DEPS $BUILD_DEPS $LIB_DEPS && rm -rf /var/lib/apt/lists/* \ && git clone https://github.com/nikic/php-ast.git && cd php-ast && phpize && ./configure && make && make install && cd .. && rm -rf php-ast && docker-php-ext-enable ast \ diff --git a/Dockerfile-alpine b/Dockerfile-alpine index 44556d18..ae374c7a 100644 --- a/Dockerfile-alpine +++ b/Dockerfile-alpine @@ -11,7 +11,7 @@ ENV TOOLS_JSON=/root/tools.json COPY tools.json ${TOOLS_JSON} COPY tools.php /usr/local/bin/tools.php -COPY install-composer.sh /usr/local/bin/install-composer.sh +COPY --from=composer:1.6 /usr/bin/composer /usr/bin/composer RUN apk add --no-cache --virtual .tool-deps $TOOL_DEPS $LIB_DEPS \ && apk add --no-cache --virtual .build-deps $BUILD_DEPS \ diff --git a/install-composer.sh b/install-composer.sh deleted file mode 100755 index 809c1630..00000000 --- a/install-composer.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -EXPECTED_SIGNATURE=$(curl -Ls https://composer.github.io/installer.sig) -php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" -ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', '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 --install-dir=/usr/local/bin --filename=composer -RESULT=$? -rm composer-setup.php -exit $RESULT - diff --git a/tools.php b/tools.php index 715bd2fc..3faa0546 100644 --- a/tools.php +++ b/tools.php @@ -478,7 +478,7 @@ function LoadTools(string $source): PleaseTry 'composer', 'Dependency Manager for PHP', 'https://getcomposer.org/', - new ShCommand('/usr/local/bin/install-composer.sh'), + new ShCommand('composer self-update'), new TestCommand('composer list', 'composer') ), new Tool(