We had the same issue, ended up building ourselves and pushing to a public dockerhub repo. https://hub.docker.com/r/pathlit/lambda-rust
We started doing this only with the 1.52.1 though. The tests are run prior push. The only modification we did was to add openssh-client and git for yum to install. Then we add the Github public key under root/.ssh as we later in our flow need to pull some repos while crafting our lambdas with the serverless-rust plugin (pull via a hook). See below.
#
# This Dockerfile sole purpose is to compile and package AWS lambda functions
# using the rust runtime within a serverless framework project.
#
# https://github.com/lambci/docker-lambda#documentation
FROM lambci/lambda:build-provided.al2
ARG RUST_VERSION=1.52.1
RUN yum install -y jq openssl-devel openssh-client git
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
| CARGO_HOME=/cargo RUSTUP_HOME=/rustup sh -s -- -y --profile minimal --default-toolchain $RUST_VERSION
ADD build.sh /usr/local/bin/
VOLUME ["/code"]
WORKDIR /code
# This is necessary to prevent the "git clone" operation from failing
# with an "unknown host key" error.
RUN mkdir -m 700 /root/.ssh
RUN touch -m 600 /root/.ssh/known_hosts
RUN ssh-keyscan github.com > /root/.ssh/known_hosts
# This is as far as we go here, the rest is done late
ENTRYPOINT ["/usr/local/bin/build.sh"]
Alternatively you can definitely fork the repo, configure the action and run it yourself it works great thank to @softprops very good code.
We had the same issue, ended up building ourselves and pushing to a public dockerhub repo. https://hub.docker.com/r/pathlit/lambda-rust We started doing this only with the
1.52.1
though. The tests are run prior push. The only modification we did was to addopenssh-client
andgit
foryum
to install. Then we add the Github public key underroot/.ssh
as we later in our flow need to pull some repos while crafting our lambdas with the serverless-rust plugin (pull via ahook
). See below.Alternatively you can definitely fork the repo, configure the action and run it yourself it works great thank to @softprops very good code.