Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/php/xp/lambda/Dockerfile.runtime
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM public.ecr.aws/lambda/provided:al2 as builder
FROM public.ecr.aws/lambda/provided:al2023 AS builder

ARG php_version="?.?.?"
ARG xp_version="?.?.?"

RUN yum clean all && yum install -y \
RUN dnf clean all && dnf install -y \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

autoconf \
gcc \
gcc-c++ \
Expand Down
9 changes: 5 additions & 4 deletions src/main/php/xp/lambda/Dockerfile.test
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
ARG php_version="?.?.?"
ARG xp_version="?.?.?"

FROM lambda-xp-runtime:${php_version} as build
FROM lambda-xp-runtime:${php_version} AS build

FROM public.ecr.aws/lambda/provided:al2
FROM public.ecr.aws/lambda/provided:al2023

COPY --from=build /opt/php/bin/ /opt/bin/

Expand All @@ -14,8 +14,9 @@ RUN echo $'#!/bin/sh\n\n\
export _HANDLER="$1"\n\
/usr/local/bin/aws-lambda-rie /var/runtime/bootstrap --log-level error &\n\
pid=$!\n\
curl -s "http://localhost:8080/2015-03-31/functions/function/invocations" -d "$2"\n\
timeout 10 sh -c "until cat < /dev/null > /dev/tcp/127.0.0.1/9001 ; do sleep 0.1; done" 2>/dev/null\n\
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This likely worked due to lucky timing rather than guaranteed ordering. Seems AL2 was just slow enough that the socket was always ready by the time your script tried to connect. This is a classic heisenbug - the race condition existed but rarely manifested.

curl -s "http://127.0.0.1:8080/2015-03-31/functions/function/invocations" -d "$2"\n\
kill -2 $pid\n\
echo' > /lambda-entrypoint.sh

ENV TZ UTC
ENV TZ=UTC
Loading