Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Rust
  3. rust-musl-builder

rust-musl-builder

Apache-2.0Dockerfile

Docker images for compiling static Rust binaries using musl-libc, with static C libraries for openssl, diesel, and sqlx.

GitHubGitHub
1.6k stars192 forks0 contributors

What is rust-musl-builder?

rust-musl-builder is a set of Docker images that facilitate building static Rust binaries using musl-libc. It solves the problem of creating portable, dependency-free executables by pre-configuring static C libraries like OpenSSL and libpq, which are commonly needed by Rust crates such as diesel and sqlx.

Target Audience

Rust developers who need to deploy applications as single static binaries, particularly those using database drivers or TLS libraries that rely on native C dependencies.

Value Proposition

It simplifies the toolchain setup for static compilation, provides tested configurations for popular Rust crates, and integrates seamlessly with Docker-based build pipelines, reducing the friction of producing distributable Rust applications.

Overview

Docker images for compiling static Rust binaries using musl-libc and musl-gcc, with static versions of useful C libraries. Supports openssl and diesel crates.

Use Cases

Best For

  • Building Rust web servers that require OpenSSL for HTTPS
  • Creating CLI tools that must run on any Linux distribution without dependencies
  • Deploying Rust applications in minimal Alpine Linux containers
  • Automating static binary builds in CI/CD pipelines like Travis CI
  • Developing with diesel ORM for PostgreSQL or SQLite databases
  • Cross-compiling Rust projects for embedded or restricted environments

Not Ideal For

  • Projects using rustls for TLS instead of OpenSSL, as the image is optimized for legacy OpenSSL dependencies
  • Teams requiring extensive cross-compilation for architectures beyond x86_64 and basic armv7
  • Applications prioritizing minimal Docker image sizes without the overhead of pre-installed C libraries
  • Developers seeking actively maintained tools, as the README labels this project 'effectively dead'

Pros & Cons

Pros

Pre-configured Static Libraries

Includes static versions of OpenSSL, libpq, libz, and SQLite3, configured to work out of the box with popular Rust crates like diesel and sqlx, reducing linking headaches.

CI/CD Pipeline Ready

Designed for integration with Travis CI and GitHub releases, with examples for automating static binary builds and deploying to Alpine Linux containers.

Extras for Enhanced Workflows

Bundles tools like mdbook, cargo about, cargo deb, and cargo deny, aiding in documentation, licensing, packaging, and security checks.

Simplified Static Compilation

Abstracts the complexity of musl-libc setup, providing a Docker environment that just works for creating dependency-free executables.

Cons

Effectively Deprecated

The README openly states the project is 'effectively dead' due to the decreasing need for OpenSSL, making it a legacy choice for new projects.

Limited Cross-Platform Support

Only supports x86_64 and basic armv7 targets, lacking the broader architecture support found in alternatives like cross.

Caching Requires Manual Setup

Efficient build caching necessitates extra Docker volume mounts and permission fixes, adding complexity compared to turnkey solutions.

Frequently Asked Questions

Quick Stats

Stars1,591
Forks192
Contributors0
Open Issues11
Last commit2 years ago
CreatedSince 2016

Tags

#alpine-linux#static-linking#cross-compilation#musl-libc#ci-cd#postgresql#docker#openssl#rust

Built With

O
OpenSSL
m
musl-libc
S
SQLite3
D
Docker
l
libpq

Included in

Rust56.6k
Auto-fetched 5 hours ago

Related Projects

komodokomodo

🦎 a tool to build and deploy software on many servers 🦎

Stars11,712
Forks356
Last commit11 hours ago
cargo-chefcargo-chef

A cargo-subcommand to speed up Rust Docker builds using Docker layer caching.

Stars2,664
Forks143
Last commit3 months ago
release-plzrelease-plz

Publish Rust crates from CI with a Release PR.

Stars1,431
Forks179
Last commit14 hours ago
rust-musl-crossrust-musl-cross

Docker images for compiling static Rust binaries using musl-cross

Stars748
Forks80
Last commit16 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub