A humble test to benchmark QEMU as an engine to run untrusted code in AWS Lambda.
One can invoke ./run.sh
locally to ensure that everything works as expected
before deploying the container image to AWS Lambda.
FROM alpine:latest AS builder | |
RUN apk update && apk add git cmake build-base curl-dev libexecinfo-dev | |
WORKDIR /root | |
RUN git clone https://github.com/mejedi/vmwrap.git vmwrap.git | |
RUN cd vmwrap.git \ | |
&& make \ | |
&& DESTDIR=/root/dist make install | |
COPY vmwrap-kernel-default dist/usr/lib/vmwrap/kernel/default | |
RUN git clone https://github.com/awslabs/aws-lambda-cpp.git aws-lambda-cpp.git | |
RUN cd aws-lambda-cpp.git \ | |
&& mkdir build && cd build \ | |
&& cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/aws-lambda-cpp \ | |
&& make && make install | |
COPY timing_test.cpp timing_test.cpp | |
RUN g++ timing_test.cpp -I aws-lambda-cpp/include/ -L aws-lambda-cpp/lib/ -laws-lambda-runtime -lcurl -o /root/dist/timing_test | |
COPY m.lua t.sh dist/ | |
FROM alpine:latest | |
RUN apk add luajit qemu-system-x86_64 libstdc++ libcurl | |
COPY --from=builder /root/dist / | |
ENTRYPOINT [ "/timing_test" ] |
(Sorry about that, but we can’t show files that are this big right now.)
(Sorry about that, but we can’t show files that are this big right now.)