Les Partages de Memiks
Tag cloud
Picture wall
Daily
RSS Feed
  • RSS Feed
  • Daily Feed
  • Weekly Feed
  • Monthly Feed
Filters

Links per page

  • 20 links
  • 50 links
  • 100 links

Filters

Untagged links
1 result tagged musl  ✕
GitHub - clux/muslrust: Docker environment for building musl based static rust binaries https://github.com/clux/muslrust/
Thu Feb 14 11:06:35 2019 archive.org
QRCode
thumbnail

A plain docker environment for building static binaries compiled with rust and linked against musl instead of glibc. Built nightly on travis.

This is only useful if you require external C dependencies, because otherwise you could do rustup target add x86_64-unknown-linux-musl.

This container comes with a bunch of statically compiled C libraries using musl-gcc so that we can statically link against these as well.

If you already have rustup installed on the machine that should compile, you might consider cross as a more general solution for cross compiling rust binaries.
Usage

Pull and run from a rust project root:

docker pull clux/muslrust
docker run -v $PWD:/volume --rm -t clux/muslrust cargo build

You should have a static executable in the target folder:

ldd target/x86_64-unknown-linux-musl/debug/EXECUTABLE
not a dynamic executable

From there on, you can include it in a blank docker image (because everything you need is included in the binary) and perhaps end up with a 5MB docker blog image.

rust compile docker musl static
4756 links, including 1670 private
Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Theme by kalvn