Is there a way to tell Cargo to install and build all my dependencies, but not attempt to build my application?
I thought cargo install would do that, b
If you add a dummy main or lib file, you can use cargo build to just pull down the dependencies. I'm currently using this solution for my Docker based project:
COPY Cargo.toml .
RUN mkdir src \
&& echo "// dummy file" > src/lib.rs \
&& cargo build
I'm using --volumes, so I'm done at this point. The host volumes come in and blow away the dummy file, and cargo uses the cached dependencies when I go to build the source later. This solution will work just as well if you want to add a COPY (or ADD) later and use the cached dependencies though.