Error with rust-openssl and Alpine Linux
kirillt opened this issue · comments
Kirill Taran commented
Hey, the following Dockerfile:
FROM alpine
RUN apk add git cargo pkgconfig openssl openssl-dev
RUN git clone https://github.com/sfackler/rust-openssl /build
RUN cd /build && cargo build --release
produces the following error:
error: failed to run custom build command for `systest v0.1.0 (/build/systest)`
Caused by:
process didn't exit successfully: `/build/target/release/build/systest-9a76ac7552bababf/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'unknown os/family width: x86_64-alpine-linux-musl', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/ctest-0.2.22/src/lib.rs:1117:9
Is it correct that this panic comes from ctest
?
Kirill Taran commented
The problem is that Alpine uses target x86_64-alpine-linux-musl
instead of x86_64-unknown-linux-musl
. Installing Rust manually with latter target helps. Here is the working Dockerfile:
FROM alpine:edge
RUN apk add git curl
RUN apk add pkgconfig openssl-dev gcc musl-dev rustup
RUN rustup-init -t x86_64-unknown-linux-musl --default-toolchain nightly --profile minimal -y
RUN git clone https://github.com/sfackler/rust-openssl /build
RUN cd /build && /root/.cargo/bin/cargo build --release
This is probably not a bug, so closing the issue.