Skip to content

Building rust application with PyO3 dependency fails inside docker #4242

Discussion options

You must be logged in to vote

I have fixed it by not using the x86_64-unknown-linux-musl target but I'm not sure why.

I could cleanup the dockerfile a bit too

FROM rust:1.78.0-bookworm as builder

WORKDIR /build

COPY . .
ARG SQLX_OFFLINE=true

RUN apt update && \ 
    apt install -y python3-dev libpython3-dev python3-pip musl-dev
    
RUN python3 -m pip install --no-cache-dir --break-system-packages -r apps/blade/requirements.txt

RUN cargo build --bin blade --release

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@AlexanderProd
Comment options

Answer selected by AlexanderProd
@davidhewitt
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants