Skip to content

Instantly share code, notes, and snippets.

@peterhel
Created December 12, 2024 16:41
Show Gist options
  • Select an option

  • Save peterhel/af3617e0ef4c3c14a206c664b98fadd9 to your computer and use it in GitHub Desktop.

Select an option

Save peterhel/af3617e0ef4c3c14a206c664b98fadd9 to your computer and use it in GitHub Desktop.
After days of fighting with mingw and mac osx and an old linux laptop... this it what I finally settled with to get my rust lambda compiled.
# 1. This tells docker to use the Rust official image
FROM debian
SHELL ["/bin/bash", "-c"]
RUN apt update && apt install python3-pip python3-venv pkg-config libssl-dev curl -y
RUN python3 -m venv /venv
ENV PATH="/venv/bin:/root/.cargo/bin/:$PATH"
ENV RUST_BACKTRACE=1
RUN python3 -m pip install ziglang
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
RUN cargo install --locked cargo-zigbuild
RUN cargo install --locked cargo-lambda
WORKDIR /opt/
CMD ["cargo", "lambda", "build"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment