From 85f16789b4867f76b525f5674158f60669b55a92 Mon Sep 17 00:00:00 2001 From: Gianni Ciccarelli Date: Fri, 6 May 2022 18:56:27 +0200 Subject: [PATCH] Using docker multi-stage to pin composer to a specific version Signed-off-by: Gianni Ciccarelli --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 2ce48e5..b956d1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,7 @@ # docker build -f Dockerfile-dev -t api-tools . # docker run -it -p "8080:80" -v $PWD:/var/www api-tools # +FROM composer:2.3.5 AS get-composer FROM php:8.0-apache RUN apt-get update \ @@ -31,7 +32,8 @@ RUN apt-get update \ && a2enmod rewrite \ && sed -i 's!/var/www/html!/var/www/public!g' /etc/apache2/sites-available/000-default.conf \ && mv /var/www/html /var/www/public \ - && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ && echo "AllowEncodedSlashes On" >> /etc/apache2/apache2.conf +COPY --from=get-composer /usr/bin/composer /usr/local/bin/composer + WORKDIR /var/www