Skip to content

Commit cb6df47

Browse files
committed
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
1 parent 900120a commit cb6df47

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
# elecena.pl (c) 2015-2020
22

3+
# @see https://hub.docker.com/_/composer
4+
FROM composer:1.10.5 AS php-composer
5+
36
# @see https://hub.docker.com/_/python/
47
FROM python:3.8-alpine
58
RUN pip install virtualenv && rm -rf /root/.cache
69

10+
# copy composer from the first stage
11+
COPY --from=php-composer /usr/bin/composer /usr/bin
12+
713
# install dependencies
814
RUN apk update && apk add \
915
php7 \
@@ -38,12 +44,12 @@ RUN apk update && apk add \
3844
php7-xmlwriter \
3945
php7-xml \
4046
php7-xsl \
41-
&& rm -rf /tmp /var/log/* /var/cache/*
47+
&& rm -rf /tmp/* /var/log/* /var/cache/*
4248

4349
ENV PHP_VERSION 7.3.16
4450

4551
# add an info script
4652
WORKDIR /opt
4753

48-
RUN echo "echo -e '### Python'; python -V; virtualenv --version; echo -e '\n### PHP'; php -v; php -m" > info.sh
54+
RUN echo "echo -e '### Python'; python -V; virtualenv --version; echo -e '\n### PHP'; php -v; composer -V; php -m" > info.sh
4955
RUN chmod 744 info.sh

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ docker pull elecena/python-php
1111

1212
```
1313
REPOSITORY TAG IMAGE ID CREATED SIZE
14-
elecena/python-php 3.8-7.3-alpine c9cc8676df95 36 minutes ago 139MB
14+
elecena/python-php 3.8-7.3-alpine-composer c9cc8676df95 6 minutes ago 141MB
1515
```
1616

1717
## Installed software
@@ -28,6 +28,7 @@ PHP 7.3.16 (cli) (built: Mar 20 2020 11:26:40) ( NTS )
2828
Copyright (c) 1997-2018 The PHP Group
2929
Zend Engine v3.3.16, Copyright (c) 1998-2018 Zend Technologies
3030
with Zend OPcache v7.3.16, Copyright (c) 1999-2018, by Zend Technologies
31+
Composer version 1.10.5 2020-04-10 11:44:22
3132
[PHP Modules]
3233
calendar
3334
Core

0 commit comments

Comments
 (0)