Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit 9bc0592

Browse files
committed
Install composer and guzzle
1 parent 159b87e commit 9bc0592

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

Dockerfile

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
11
####### PHP custom runtime #######
22

3+
####### Install and compile everything #######
4+
35
# Same AL version as Lambda execution environment AMI
4-
FROM amazonlinux:2017.03.1.20170812 as customruntime
6+
FROM amazonlinux:2017.03.1.20170812 as builder
57

68
# Lock to 2017.03 release (same as Lambda) and install compilation dependencies
79
RUN sed -i 's;^releasever.*;releasever=2017.03;;' /etc/yum.conf && \
810
yum clean all && \
9-
yum install autoconf bison gcc gcc-c++ make libcurl-devel libxml2-devel openssl-devel tar gzip -y
11+
yum install -y autoconf \
12+
bison \
13+
gcc \
14+
gcc-c++ \
15+
make \
16+
libcurl-devel \
17+
libxml2-devel \
18+
openssl-devel \
19+
tar \
20+
gzip \
21+
zip \
22+
unzip \
23+
git
1024

11-
# Download the PHP 7.3.0 source, compile it, and install to /opt/php-7-bin
25+
# Download the PHP 7.3.0 source, compile, and install
1226
RUN mkdir ~/php-7-bin && \
1327
curl -sL https://github.com/php/php-src/archive/php-7.3.0.tar.gz | tar -xvz && \
1428
cd php-src-php-7.3.0 && \
@@ -17,6 +31,16 @@ RUN mkdir ~/php-7-bin && \
1731
make install && \
1832
/opt/php-7-bin/bin/php -v
1933

20-
###### Something else ######
34+
WORKDIR /runtime
35+
RUN mkdir bin && \
36+
cp /opt/php-7-bin/bin/php bin/php
37+
38+
# Install composer and guzzle lib
39+
RUN curl -sS https://getcomposer.org/installer | ./bin/php -- --install-dir=/runtime/bin --filename=composer && \
40+
./bin/php ./bin/composer require guzzlehttp/guzzle
41+
42+
###### Create runtime image ######
43+
44+
FROM lambci/lambda:provided as runtime
2145

22-
FROM lambci/lambda:provided
46+
COPY --from=builder /runtime /opt

0 commit comments

Comments
 (0)