SIGSEGV with program linked against OpenSSL in an Alpine container

The x86_64-unknown-linux-musl target statically links to MUSL by default, but Alpine uses a dynamically linked MUSL. Since you're dynamically linking to Alpine's OpenSSL, you're ending up with 2 MUSLs and then things explode from there. You can pass RUSTFLAGS=-C target-feature=-crt-static to have rustc dynamically link to Alpine's MUSL, or build an OpenSSL that also statically links to MUSL (e.g. with openssl's vendored Cargo feature).

7 Likes