Skip to content

Instantly share code, notes, and snippets.

@kornelski
Last active February 10, 2023 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kornelski/21f2a3048f79447c85ee72d0240b241b to your computer and use it in GitHub Desktop.
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
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