Last active
February 10, 2023 14:33
-
-
Save kornelski/21f2a3048f79447c85ee72d0240b241b to your computer and use it in GitHub Desktop.
Minimal docker image for building x86-64 .deb packages from Rust/Cargo on Apple Silicon (M1/M2) Mac host
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM rust:1-slim-bullseye | |
RUN rustup target add x86_64-unknown-linux-gnu | |
RUN dpkg --add-architecture amd64 | |
RUN apt-get update; apt-get install build-essential crossbuild-essential-amd64 pkg-config libssl-dev:amd64 libsqlite3-dev:amd64 -y | |
RUN cargo install cargo-deb | |
ENV HOST_CC=gcc | |
ENV CC_x86_64_unknown_linux_gnu=/usr/bin/x86_64-linux-gnu-gcc | |
# now copy your sources and run `cargo deb --target x86_64-unknown-linux-gnu` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment