Skip to content

unixgeek/docker-rust-min-libc-target

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

Docker Rust Minimum glibc Target

This Docker image is used to compile Rust targeting a minimum glibc for more portable binaries. It is based on the official Rust Docker image and uses a toolchain, built using crosstool-ng, that mirrors glibc from Ubuntu 14.04. It also includes OpenSSL.

Usage

Compile

docker container run --rm --volume "$(pwd)":/src     \
    --init --tty --user "$(id --user):$(id --group)" \
    unixgeek2/rust-min-libc build --release

Check glibc dependencies

objdump -T BINARY | grep GLIBC | sed 's/.*GLIBC_\([.0-9]*\).*/\1/g' | sort -Vu

Compatability

As a smoke test, a simple Rust binary that uses the openssl crate was compiled two ways: first with the default feature set and second with the vendored feature. It was then executed on the following Docker images:

  • ubuntu:14.04
  • ubuntu:16.04
  • ubuntu:18.04
  • ubuntu:20.04
  • ubuntu:22.04
  • ubuntu:24.04
  • debian:buster-slim
  • debian:bullseye-slim
  • debian:bookworm-slim
  • rockylinux:8
  • rockylinux:9
  • opensuse/tumbleweed:latest
  • opensuse/leap:latest

Docker Hub

rust-min-libc

Credits

About

Compile Rust using a minimum glibc for greater compatability.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published