{"id":13446820,"url":"https://github.com/Peco602/rust-universal-compiler","last_synced_at":"2025-03-21T16:32:55.453Z","repository":{"id":41093742,"uuid":"508256092","full_name":"Peco602/rust-universal-compiler","owner":"Peco602","description":"Container solution to compile Rust projects for Linux, macOS and Windows","archived":false,"fork":false,"pushed_at":"2023-04-30T17:04:02.000Z","size":10,"stargazers_count":32,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-28T11:43:38.675Z","etag":null,"topics":["container","cross-compilation","docker","linux","macos","rust","windows"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","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/Peco602.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-06-28T10:38:32.000Z","updated_at":"2024-10-01T09:54:02.000Z","dependencies_parsed_at":"2024-01-07T10:50:49.944Z","dependency_job_id":"e36a0ef5-5ac7-4120-9032-71e8bda8d2a7","html_url":"https://github.com/Peco602/rust-universal-compiler","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Peco602%2Frust-universal-compiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Peco602%2Frust-universal-compiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Peco602%2Frust-universal-compiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Peco602%2Frust-universal-compiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Peco602","download_url":"https://codeload.github.com/Peco602/rust-universal-compiler/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244829632,"owners_count":20517348,"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":["container","cross-compilation","docker","linux","macos","rust","windows"],"created_at":"2024-07-31T05:01:00.735Z","updated_at":"2025-03-21T16:32:54.618Z","avatar_url":"https://github.com/Peco602.png","language":"Dockerfile","readme":"![Test](https://github.com/Peco602/rust-universal-compiler/actions/workflows/test.yml/badge.svg)\r\n[![Mentioned in awesome-docker](https://awesome.re/mentioned-badge.svg)](https://github.com/veggiemonk/awesome-docker)\r\n\r\n# Rust Universal Compiler Docker image\r\n\r\nContainer solution to compile Rust projects for Linux, macOS and Windows.\r\n\r\n\r\n## Build the image\r\n\r\n```ps1\r\ndocker build -t rust-universal-compiler:latest .\r\n```\r\n\r\n## Configure the project\r\n\r\nTo allow cross-compilation from Linux to Windows and MacOS, it is necessary to create in the project folder the `.cargo/config` file containing the following lines:\r\n\r\n```ini\r\n[target.x86_64-pc-windows-msvc]\r\nrustflags = [\"-C\", \"target-feature=+crt-static\"]\r\n\r\n[target.x86_64-apple-darwin]\r\nlinker = \"x86_64-apple-darwin14-clang\"\r\nar = \"x86_64-apple-darwin14-ar\"\r\n```\r\n\r\n## Compile the project\r\n\r\nCompile for Linux (`x86_64-unknown-linux-gnu`):\r\n\r\n```bash\r\ndocker run --rm -v $PWD/test-project:/app -w /app rust-universal-compiler:latest cargo build --target x86_64-unknown-linux-gnu --release\r\n```\r\n\r\nCompile for MacOS (`x86_64-apple-darwin`):\r\n\r\n```bash\r\ndocker run --rm -v $PWD/test-project:/app -w /app rust-universal-compiler:latest cargo build --target x86_64-apple-darwin --release\r\n```\r\n\r\nCompile for Windows (`x86_64-pc-windows-msvc`):\r\n\r\n```bash\r\ndocker run --rm -v $PWD/test-project:/app -w /app rust-universal-compiler:latest cargo build --target x86_64-pc-windows-msvc --release\r\n```\r\n\r\n## DockerHub\r\n\r\n- [peco602/rust-universal-compiler](https://hub.docker.com/r/peco602/rust-universal-compiler)\r\n\r\n\r\n## Bibliography\r\n\r\n- https://github.com/Jake-Shadle/xwin\r\n- https://wapl.es/rust/2019/02/17/rust-cross-compile-linux-to-macos.html\r\n","funding_links":[],"categories":["Development with Docker"],"sub_categories":["Development Environment"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPeco602%2Frust-universal-compiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPeco602%2Frust-universal-compiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPeco602%2Frust-universal-compiler/lists"}