-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.runtime
More file actions
executable file
·39 lines (32 loc) · 1005 Bytes
/
Copy pathDockerfile.runtime
File metadata and controls
executable file
·39 lines (32 loc) · 1005 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM public.ecr.aws/lambda/provided:al2023 AS builder
ARG php_version="?.?.?"
ARG xp_version="?.?.?"
RUN dnf clean all && dnf install -y \
autoconf \
gcc \
gcc-c++ \
make \
re2c \
openssl-devel \
libxml2-devel \
tar \
gzip \
zip \
bison
# Build PHP
RUN curl -L https://github.com/php/php-src/archive/php-${php_version}.tar.gz | tar -xvz
RUN cd php-src-php-${php_version} && ./buildconf --force && ./configure \
--prefix=/opt/php/ \
--without-sqlite3 \
--with-zlib \
--with-openssl \
--enable-bcmath \
--disable-pdo && \
make -j $(nproc) all install
# Create XP Bootstrap
RUN curl -L https://github.com/xp-runners/reference/releases/download/v${xp_version}/xp-run-${xp_version}.sh \
| sed -e 's/"$@"/xp.lambda.AwsRunner/g' > /opt/php/bootstrap \
&& chmod 755 /opt/php/bootstrap \
&& head -1 /opt/php/bootstrap | grep '^#!'
RUN echo "memory_limit=-1" > /opt/php/bin/php.ini
RUN cd /opt/php && strip bin/php && zip -9 runtime.zip bin/php bin/php.ini bootstrap