Open valeriansaliou opened 4 years ago
Falling back on a cross-compiled binary that depends on GNU libraries instead (GLIBC).
Quoting from: https://github.com/rust-rocksdb/rust-rocksdb/issues/440#issuecomment-704959749 Will try this soon!
FROM alpine:edge as build
WORKDIR /work
RUN apk --no-cache add rust cargo g++ openssl openssl-dev clang jq ca-certificates bash linux-headers
ENV OPENSSL_STATIC=yes \
PKG_CONFIG_ALLOW_CROSS=true \
PKG_CONFIG_ALL_STATIC=true \
RUSTFLAGS="-C target-feature=+crt-static"
COPY . .
RUN --mount=type=ssh \
--mount=type=cache,target=/root/.cargo/registry \
--mount=type=cache,target=/root/.cargo/git \
--mount=type=cache,target=/work/target \
cargo install --release --target x86_64-alpine-linux-musl
FROM scratch
WORKDIR /work
ENV PATH=/work:${PATH}
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /root/.cargo/bin/exe /work
ENTRYPOINT ["exe"]
Currently not possible due to __dso_handle linking failures due to GCC.