File tree Expand file tree Collapse file tree 3 files changed +33
-33
lines changed
Expand file tree Collapse file tree 3 files changed +33
-33
lines changed Original file line number Diff line number Diff line change @@ -177,17 +177,6 @@ RUN set -xe; \
177177 cp php.ini-production ${INSTALL_DIR}/etc/php/php.ini
178178
179179
180- # Compress the PHP binary and the PHP-FPM binary with UPX to reduce their size
181- # --best: use the best compression method
182- RUN set -xe; \
183- export UPX_ARCH=$(test "${IMAGE_VERSION_SUFFIX}" = "x86_64" && echo amd64 || echo arm64); \
184- curl -L -o upx.tgz https://github.com/upx/upx/releases/download/v5.0.2/upx-5.0.2-${UPX_ARCH}_linux.tar.xz; \
185- tar xf upx.tgz; \
186- mv upx-*/upx /usr/local/bin/
187- RUN upx --best ${INSTALL_DIR}/bin/php && \
188- upx --best ${INSTALL_DIR}/sbin/php-fpm
189-
190-
191180# Install extensions
192181# We can install extensions manually or using `pecl`
193182RUN pecl install APCu
@@ -230,6 +219,17 @@ RUN find /bref-layer/bref/extensions -type f -exec strip --strip-all {} +
230219RUN find /bref-layer/lib -type f -exec strip --strip-all {} +
231220
232221
222+ # Compress the PHP binary and the PHP-FPM binary with UPX to reduce their size
223+ # --best: use the best compression method
224+ RUN set -xe; \
225+ export UPX_ARCH=$(test "${IMAGE_VERSION_SUFFIX}" = "x86_64" && echo amd64 || echo arm64); \
226+ curl -L -o upx.tgz https://github.com/upx/upx/releases/download/v5.0.2/upx-5.0.2-${UPX_ARCH}_linux.tar.xz; \
227+ tar xf upx.tgz; \
228+ mv upx-*/upx /usr/local/bin/
229+ RUN upx --best /bref-layer/bin/php && \
230+ upx --best /bref-layer/bin/php-fpm
231+
232+
233233# ----------------------------------------------------------------------------
234234# Start from a clean image to copy only the files we need for the Lambda layer
235235FROM public.ecr.aws/lambda/provided:al2023-${IMAGE_VERSION_SUFFIX} as function
Original file line number Diff line number Diff line change @@ -177,17 +177,6 @@ RUN set -xe; \
177177 cp php.ini-production ${INSTALL_DIR}/etc/php/php.ini
178178
179179
180- # Compress the PHP binary and the PHP-FPM binary with UPX to reduce their size
181- # --best: use the best compression method
182- RUN set -xe; \
183- export UPX_ARCH=$(test "${IMAGE_VERSION_SUFFIX}" = "x86_64" && echo amd64 || echo arm64); \
184- curl -L -o upx.tgz https://github.com/upx/upx/releases/download/v5.0.2/upx-5.0.2-${UPX_ARCH}_linux.tar.xz; \
185- tar xf upx.tgz; \
186- mv upx-*/upx /usr/local/bin/
187- RUN upx --best ${INSTALL_DIR}/bin/php && \
188- upx --best ${INSTALL_DIR}/sbin/php-fpm
189-
190-
191180# Install extensions
192181# We can install extensions manually or using `pecl`
193182RUN pecl install APCu
@@ -230,6 +219,17 @@ RUN find /bref-layer/bref/extensions -type f -exec strip --strip-all {} +
230219RUN find /bref-layer/lib -type f -exec strip --strip-all {} +
231220
232221
222+ # Compress the PHP binary and the PHP-FPM binary with UPX to reduce their size
223+ # --best: use the best compression method
224+ RUN set -xe; \
225+ export UPX_ARCH=$(test "${IMAGE_VERSION_SUFFIX}" = "x86_64" && echo amd64 || echo arm64); \
226+ curl -L -o upx.tgz https://github.com/upx/upx/releases/download/v5.0.2/upx-5.0.2-${UPX_ARCH}_linux.tar.xz; \
227+ tar xf upx.tgz; \
228+ mv upx-*/upx /usr/local/bin/
229+ RUN upx --best /bref-layer/bin/php && \
230+ upx --best /bref-layer/bin/php-fpm
231+
232+
233233# ----------------------------------------------------------------------------
234234# Start from a clean image to copy only the files we need for the Lambda layer
235235FROM public.ecr.aws/lambda/provided:al2023-${IMAGE_VERSION_SUFFIX} as function
Original file line number Diff line number Diff line change @@ -176,17 +176,6 @@ RUN set -xe; \
176176 cp php.ini-production ${INSTALL_DIR}/etc/php/php.ini
177177
178178
179- # Compress the PHP binary and the PHP-FPM binary with UPX to reduce their size
180- # --best: use the best compression method
181- RUN set -xe; \
182- export UPX_ARCH=$(test "${IMAGE_VERSION_SUFFIX}" = "x86_64" && echo amd64 || echo arm64); \
183- curl -L -o upx.tgz https://github.com/upx/upx/releases/download/v5.0.2/upx-5.0.2-${UPX_ARCH}_linux.tar.xz; \
184- tar xf upx.tgz; \
185- mv upx-*/upx /usr/local/bin/
186- RUN upx --best ${INSTALL_DIR}/bin/php && \
187- upx --best ${INSTALL_DIR}/sbin/php-fpm
188-
189-
190179# Install extensions
191180# We can install extensions manually or using `pecl`
192181RUN pecl install APCu
@@ -229,6 +218,17 @@ RUN find /bref-layer/bref/extensions -type f -exec strip --strip-all {} +
229218RUN find /bref-layer/lib -type f -exec strip --strip-all {} +
230219
231220
221+ # Compress the PHP binary and the PHP-FPM binary with UPX to reduce their size
222+ # --best: use the best compression method
223+ RUN set -xe; \
224+ export UPX_ARCH=$(test "${IMAGE_VERSION_SUFFIX}" = "x86_64" && echo amd64 || echo arm64); \
225+ curl -L -o upx.tgz https://github.com/upx/upx/releases/download/v5.0.2/upx-5.0.2-${UPX_ARCH}_linux.tar.xz; \
226+ tar xf upx.tgz; \
227+ mv upx-*/upx /usr/local/bin/
228+ RUN upx --best /bref-layer/bin/php && \
229+ upx --best /bref-layer/bin/php-fpm
230+
231+
232232# ----------------------------------------------------------------------------
233233# Start from a clean image to copy only the files we need for the Lambda layer
234234FROM public.ecr.aws/lambda/provided:al2023-${IMAGE_VERSION_SUFFIX} as function
You can’t perform that action at this time.
0 commit comments