{"id":28073351,"url":"https://github.com/messense/rust-musl-cross","last_synced_at":"2025-05-12T22:01:56.006Z","repository":{"id":25823168,"uuid":"106551458","full_name":"rust-cross/rust-musl-cross","owner":"rust-cross","description":"Docker images for compiling static Rust binaries using musl-cross","archived":false,"fork":false,"pushed_at":"2025-05-01T12:29:32.000Z","size":479,"stargazers_count":685,"open_issues_count":8,"forks_count":74,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-05-08T22:03:14.769Z","etag":null,"topics":["docker-image","musl-cross","musl-libc","rust"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rust-cross.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"messense"}},"created_at":"2017-10-11T12:30:13.000Z","updated_at":"2025-05-07T08:29:12.000Z","dependencies_parsed_at":"2024-02-18T16:25:41.914Z","dependency_job_id":"e9fd97b8-7b94-46e6-8b53-3962910c6575","html_url":"https://github.com/rust-cross/rust-musl-cross","commit_stats":null,"previous_names":["messense/rust-musl-cross"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-cross%2Frust-musl-cross","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-cross%2Frust-musl-cross/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-cross%2Frust-musl-cross/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rust-cross%2Frust-musl-cross/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rust-cross","download_url":"https://codeload.github.com/rust-cross/rust-musl-cross/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253830925,"owners_count":21971001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker-image","musl-cross","musl-libc","rust"],"created_at":"2025-05-12T22:01:54.723Z","updated_at":"2025-05-12T22:01:55.938Z","avatar_url":"https://github.com/rust-cross.png","language":"Shell","funding_links":["https://github.com/sponsors/messense"],"categories":["Development tools","开发工具 Development tools","开发工具"],"sub_categories":["Deployment","部署 Deployment","部署"],"readme":"# rust-musl-cross\n\n[![Docker Image](https://img.shields.io/docker/pulls/messense/rust-musl-cross.svg?maxAge=2592000)](https://hub.docker.com/r/messense/rust-musl-cross/)\n[![Build](https://github.com/rust-cross/rust-musl-cross/workflows/Build/badge.svg)](https://github.com/rust-cross/rust-musl-cross/actions?query=workflow%3ABuild)\n[![Bors enabled](https://bors.tech/images/badge_small.svg)](https://app.bors.tech/repositories/58197)\n\n\u003e 🚀 Help me to become a full-time open-source developer by [sponsoring me on GitHub](https://github.com/sponsors/messense)\n\nDocker images for compiling static Rust binaries using [musl-cross-make][],\ninspired by [rust-musl-builder](https://github.com/emk/rust-musl-builder)\n\n## Prebuilt images\n\nCurrently we have the following [prebuilt Docker images on Docker Hub](https://hub.docker.com/r/messense/rust-musl-cross/),\n supports x86_64(amd64) and aarch64(arm64) architectures.\n\n| Rust toolchain | Cross Compile Target             | Docker Image Tag   |\n| -------------- | -------------------------------- | ------------------ |\n| stable         | aarch64-unknown-linux-musl       | aarch64-musl       |\n| stable         | arm-unknown-linux-musleabi       | arm-musleabi       |\n| stable         | arm-unknown-linux-musleabihf     | arm-musleabihf     |\n| stable         | armv5te-unknown-linux-musleabi   | armv5te-musleabi   |\n| stable         | armv7-unknown-linux-musleabi     | armv7-musleabi     |\n| stable         | armv7-unknown-linux-musleabihf   | armv7-musleabihf   |\n| stable         | i586-unknown-linux-musl          | i586-musl          |\n| stable         | i686-unknown-linux-musl          | i686-musl          |\n| stable         | mips-unknown-linux-musl          | mips-musl          |\n| stable         | mipsel-unknown-linux-musl        | mipsel-musl        |\n| stable         | mips64-unknown-linux-muslabi64   | mips64-muslabi64   |\n| stable         | mips64el-unknown-linux-muslabi64 | mips64el-muslabi64 |\n| stable         | powerpc64le-unknown-linux-musl   | powerpc64le-musl   |\n| stable         | riscv64gc-unknown-linux-musl     | riscv64gc-musl     |\n| stable         | x86\\_64-unknown-linux-musl       | x86\\_64-musl       |\n\nTo use `armv7-unknown-linux-musleabihf` target for example, first pull the image:\n\n```bash\ndocker pull ghcr.io/rust-cross/rust-musl-cross:armv7-musleabihf\n# Also available on Docker Hub\n# docker pull messense/rust-musl-cross:armv7-musleabihf\n```\n\nThen you can do:\n\n```bash\nalias rust-musl-builder='docker run --rm -it -v \"$(pwd)\":/home/rust/src ghcr.io/rust-cross/rust-musl-cross:armv7-musleabihf'\nrust-musl-builder cargo build --release\n```\n\nThis command assumes that `$(pwd)` is readable and writable. It will output binaries in `armv7-unknown-linux-musleabihf`.\nAt the moment, it doesn't attempt to cache libraries between builds, so this is best reserved for making final release builds.\n\n## How it works\n\n`rust-musl-cross` uses [musl-libc][], [musl-gcc][] with the help of [musl-cross-make][] to make it easy to compile, and the new\n[rustup][] `target` support.\n\n\n## Use beta/nightly Rust\n\nCurrently we install stable Rust by default, if you want to switch to beta/nightly Rust, you can do it by extending\nfrom our Docker image, for example to use beta Rust for target `x86_64-unknown-linux-musl`:\n\n```dockerfile\nFROM ghcr.io/rust-cross/rust-musl-cross:x86_64-musl\nRUN rustup update beta \u0026\u0026 \\\n    rustup target add --toolchain beta x86_64-unknown-linux-musl\n```\n\n## Strip binaries\n\nYou can use the `musl-strip` command inside the image to strip binaries, for example:\n\n```bash\ndocker run --rm -it -v \"$(pwd)\":/home/rust/src ghcr.io/rust-cross/rust-musl-cross:armv7-musleabihf musl-strip /home/rust/src/target/release/example\n```\n\n[musl-libc]: http://www.musl-libc.org/\n[musl-gcc]: http://www.musl-libc.org/how.html\n[musl-cross-make]: https://github.com/richfelker/musl-cross-make\n[rustup]: https://www.rustup.rs/\n\n## License\n\nLicensed under [The MIT License](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmessense%2Frust-musl-cross","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmessense%2Frust-musl-cross","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmessense%2Frust-musl-cross/lists"}