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.
Compile
docker container run --rm --volume "$(pwd)":/src \
--init --tty --user "$(id --user):$(id --group)" \
unixgeek2/rust-min-libc build --releaseCheck glibc dependencies
objdump -T BINARY | grep GLIBC | sed 's/.*GLIBC_\([.0-9]*\).*/\1/g' | sort -VuAs 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