Skip to content

Commit 8ce9481

Browse files
committed
Strip PHP binary and create runtime layer w/ "zip -9"
See https://stackoverflow.com/questions/4179010/how-to-strip-executables-thoroughly
1 parent 0643783 commit 8ce9481

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ AWS Lambda change log
33

44
## ?.?.? / ????-??-??
55

6+
* Decreased size of runtime layer from ~8.4 MB to ~2.4 MB by using `strip`
7+
and `zip -9`, reducing layer publishing time as well as initialization duration
8+
https://stackoverflow.com/questions/4179010/how-to-strip-executables-thoroughly
9+
610
## 0.5.0 / 2021-08-22
711

812
* Renamed `task.zip` to `function.zip` in order not to introduce more

src/main/php/xp/lambda/Dockerfile.runtime

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ RUN curl -L https://baltocdn.com/xp-framework/xp-runners/distribution/downloads/
3838
| sed -e 's/"$@"/xp.lambda.AwsRunner/g' > /opt/php/bootstrap \
3939
&& chmod 755 /opt/php/bootstrap
4040

41-
RUN cd /opt/php && zip runtime.zip bin/php bootstrap
41+
RUN cd /opt/php && strip bin/php && zip -9 runtime.zip bin/php bootstrap

0 commit comments

Comments
 (0)