Hi josephg,
I want to build my Rust Application to binary using musl libc to optimize my CI/CD pipeline for Rust Application. I have used Rust FoundationDB dynamic ok, but when using like that, it take a long time to build Docker Image because of recompile the denpendent everytime.
I expect to build the Docker image with Dockerfile like that:
Blockquote
FROM rust:latest AS builder
RUN apt-get update && apt-get install musl-tools llvm clang -y
RUN wget https://www.foundationdb.org/downloads/6.2.15/ubuntu/installers/foundationdb-clients_6.2.15-1_amd64.deb && dpkg -i foundationdb-clients_6.2.15-1_amd64.deb
WORKDIR /
RUN rustup target add x86_64-unknown-linux-musl
RUN USER=root cargo new app
WORKDIR /app
COPY Cargo.toml Cargo.lock ./
RUN RUSTFLAGS=-Clinker=musl-gcc cargo build --release --target=x86_64-unknown-linux-musl
RUN rm -f target/x86_64-unknown-linux-musl/release/deps/ranker*
RUN rm src/*.rs
COPY src ./src
RUN RUSTFLAGS=-Clinker=musl-gcc cargo build --release --target=x86_64-unknown-linux-musl
But it failed because of FDB is a share library.
Have you had some experience with Rust and FoundationDB and have any solution for my problem?
Thanks!