Skip to content

Instantly share code, notes, and snippets.

@nickwanhere
Created June 17, 2022 08:31
Show Gist options
  • Select an option

  • Save nickwanhere/2a36b4eb83588783b412af61013dd075 to your computer and use it in GitHub Desktop.

Select an option

Save nickwanhere/2a36b4eb83588783b412af61013dd075 to your computer and use it in GitHub Desktop.
Compile Rust under Mac OS with Open SSL without cross-compile. Use Docker instead.
LAMBDA_ARCH="linux/x86_64"
RUST_TARGET="x86_64-unknown-linux-gnu"
RUST_VERSION="latest"
APP_NAME="app_name"
docker run -it --platform ${LAMBDA_ARCH} --rm --user "$(id -u)":"$(id -g)" -v "${PWD}":/usr/src/myapp -w /usr/src/myapp rust:${RUST_VERSION} cargo build --release --target ${RUST_TARGET} -v
cp -v ./target/${RUST_TARGET}/release/${APP_NAME} ./build/bootstrap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment