From cb6df477d85ae7bf7bedadd3fa0531b9bb4718da Mon Sep 17 00:00:00 2001 From: macbre Date: Thu, 16 Apr 2020 18:47:23 +0200 Subject: [PATCH] Add composer to the image REPOSITORY TAG IMAGE ID CREATED SIZE elecena/python-php 3.8-7.3-alpine-composer f4227196bd92 About a minute ago 141MB elecena/python-php 3.8-7.3-alpine c9cc8676df95 19 hours ago 139MB Resolves #4 --- Dockerfile | 10 ++++++++-- README.md | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 415805f..f661c02 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,15 @@ # elecena.pl (c) 2015-2020 +# @see https://hub.docker.com/_/composer +FROM composer:1.10.5 AS php-composer + # @see https://hub.docker.com/_/python/ FROM python:3.8-alpine RUN pip install virtualenv && rm -rf /root/.cache +# copy composer from the first stage +COPY --from=php-composer /usr/bin/composer /usr/bin + # install dependencies RUN apk update && apk add \ php7 \ @@ -38,12 +44,12 @@ RUN apk update && apk add \ php7-xmlwriter \ php7-xml \ php7-xsl \ - && rm -rf /tmp /var/log/* /var/cache/* + && rm -rf /tmp/* /var/log/* /var/cache/* ENV PHP_VERSION 7.3.16 # add an info script WORKDIR /opt -RUN echo "echo -e '### Python'; python -V; virtualenv --version; echo -e '\n### PHP'; php -v; php -m" > info.sh +RUN echo "echo -e '### Python'; python -V; virtualenv --version; echo -e '\n### PHP'; php -v; composer -V; php -m" > info.sh RUN chmod 744 info.sh diff --git a/README.md b/README.md index b1697d3..a9c01fe 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ docker pull elecena/python-php ``` REPOSITORY TAG IMAGE ID CREATED SIZE -elecena/python-php 3.8-7.3-alpine c9cc8676df95 36 minutes ago 139MB +elecena/python-php 3.8-7.3-alpine-composer c9cc8676df95 6 minutes ago 141MB ``` ## Installed software @@ -28,6 +28,7 @@ PHP 7.3.16 (cli) (built: Mar 20 2020 11:26:40) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.16, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.16, Copyright (c) 1999-2018, by Zend Technologies +Composer version 1.10.5 2020-04-10 11:44:22 [PHP Modules] calendar Core