Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up image builds with Docker cache mounts #995

Closed
wants to merge 4 commits into from
Closed

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Jan 19, 2024

Inspired by the slightly disturbing discussion at rust-lang/cargo#2644

@konstin
Copy link
Member

konstin commented Jan 19, 2024

What i like to do is to have an empty crate with nothing but the Cargo.toml, Cargo.lock and dummy lib.rs/main.rs, build that, then add the source and build again. The first build gets cached and when the deps didn't change the second build runs with all deps already built (https://github.com/PyO3/maturin/blob/3492c978e9a3031aaa60f3c7051990f2c621fd73/Dockerfile#L17-L25).

@zanieb
Copy link
Member Author

zanieb commented Jan 19, 2024

That makes sense although it feels like more of a hack; several comments suggest that in rust-lang/cargo#2644.

The cache mounts seem like a total pain to do in CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants