Why does cross-compiling Rust code for AWS Lambda with MUSL complain about "version `GLIBC_2.18' not found"?

Viewed 418

I'm cross-compiling my Rust code for AWS Lambda using the muslrust Docker container because it is the most popular MUSL + Rust package I could find on Docker Hub.

To compile, I do:

alias rust-docker='docker run --workdir /home/src --rm -it --volume "$(pwd)":/home/src clux/muslrust'
rust-docker cargo build

This succeeds, but when I deploy to Lambda and test it, I get the error:

/var/task/bootstrap: /lib64/libc.so.6: version `GLIBC_2.18' not found (required by /var/task/bootstrap)

I was under the impression that compiling with MUSL would create a static library that wouldn't need glibc on the server, so I'm not sure what I'm doing wrong here.

0 Answers
Related