I've been trying to invoke AWS Lambda functions (Quarkus) locally using AWS SAM CLI.
sam local invoke --template target/sam.native.yaml --event payload.json
Which is using this image.
Here is the relevant (hopefully) information.
File Dockerfile.graalbase
FROM ghcr.io/graalvm/graalvm-ce:ol8-java11-22.2.0 AS build
RUN gu install native-image
WORKDIR /project
VOLUME ["/project"]
ENTRYPOINT ["native-image"]
Built with:
docker build -f src/main/docker/Dockerfile.graalbase -t graalbase
Packaging:
mvn clean package -Dquarkus.package.type=native \
-Dquarkus.native.container-build=true \
-Dquarkus.native.builder-image=graalbase
This is what I get:
Mounting /private/var/folders/zm/0m9j6d_514q7sjpkgg6_7lzr0000gq/T/tmptq9x6jc9 as /var/task:ro,delegated inside runtime container
START RequestId: 3cf00931-c409-426d-b568-98b5a2402da8 Version: $LATEST
16 Sep 2022 15:11:25,289 [ERROR] (rapid) Init failed error=fork/exec /var/task/bootstrap: no such file or directory InvokeID=
Visiting the running container, this is the actual problem:
# The file does exist
ls -la /var/task/bootstrap
-rwxr-xr-x 1 root root 115716600 Sep 16 15:12 /var/task/bootstrap
# Executing it results in
exec /var/task/bootstrap
/var/task/bootstrap: /lib/ld-linux-aarch64.so.1: bad ELF interpreter: No such file or directory
Additional args:
-H:+RemoveSaturatedTypeFlows,\
-H:+PrintAnalysisStatistics
- My bet was inspired by this discussion.
- The approach suggested here leads to the build getting stuck.
UPDATED
Quoting Clement Escoffier:
Yes, you got an ARM 64 container, not a Linux 64 container. Cross-compilation is not supported by graalvm.
I'm working on a way to enable it using qemu, but I'm only at the beginning of the journey.
In short, support is on the way ;)