{"id":21715771,"url":"https://github.com/0xmad/cargo-build-dependencies","last_synced_at":"2025-10-05T15:12:47.371Z","repository":{"id":52451400,"uuid":"264655267","full_name":"0xmad/cargo-build-dependencies","owner":"0xmad","description":" Tool to build dependencies only for rust projects using cargo. Helps speed up docker builds.","archived":false,"fork":false,"pushed_at":"2021-04-28T22:20:24.000Z","size":32,"stargazers_count":10,"open_issues_count":7,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T13:53:46.465Z","etag":null,"topics":["cargo-dependencies-only","cargo-plugins","cargo-subcommand","development-tools"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xmad.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-17T12:02:04.000Z","updated_at":"2025-03-05T00:07:23.000Z","dependencies_parsed_at":"2022-08-19T04:51:18.606Z","dependency_job_id":null,"html_url":"https://github.com/0xmad/cargo-build-dependencies","commit_stats":null,"previous_names":["errmac-v/cargo-build-dependencies"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xmad%2Fcargo-build-dependencies","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xmad%2Fcargo-build-dependencies/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xmad%2Fcargo-build-dependencies/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xmad%2Fcargo-build-dependencies/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xmad","download_url":"https://codeload.github.com/0xmad/cargo-build-dependencies/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248623055,"owners_count":21135171,"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":["cargo-dependencies-only","cargo-plugins","cargo-subcommand","development-tools"],"created_at":"2024-11-26T00:47:11.906Z","updated_at":"2025-10-05T15:12:47.274Z","avatar_url":"https://github.com/0xmad.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cargo-build-dependencies\n\n[![Crates.io](https://img.shields.io/crates/v/cargo-build-dependencies.svg)](https://crates.io/crates/cargo-build-dependencies)\n\nThis tool extends [Cargo](https://doc.rust-lang.org/cargo/) to allow you to\nbuild only the dependencies in a given rust project. This is useful for docker\nbuilds where each build step is cached. The time it takes to build dependencies\nis often a significant portion of the overall build time. Therefore it is\nbeneficial in docker builds to build dependencies in a separate step earlier\nthan the main build. Since the dependency building step will be cached,\ndependencies will not need to be rebuilt when the project's own source code\nchanges.\n\nBased on https://github.com/nacardin/cargo-build-deps\n\n\n## Install\n`cargo install cargo-build-dependencies`\n\n## Usage\n`cargo build-dependencies`\n\n## Example\n\nChange Dockerfile from\n\n```\nFROM rust:1.43 as rust-builder\nRUN mkdir /tmp/PROJECT_NAME\nWORKDIR /tmp/PROJECT_NAME\nCOPY . .\nRUN cargo build  --release\n```\n\nto\n\n```\nFROM rust:1.43 as rust-builder\nRUN cargo install cargo-build-dependencies\nRUN cd /tmp \u0026\u0026 USER=root cargo new --bin PROJECT_NAME\nWORKDIR /tmp/PROJECT_NAME\nCOPY Cargo.toml Cargo.lock ./\nRUN cargo build-dependencies --release\nCOPY src /tmp/PROJECT_NAME/src\nRUN cargo build  --release\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xmad%2Fcargo-build-dependencies","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xmad%2Fcargo-build-dependencies","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xmad%2Fcargo-build-dependencies/lists"}