You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the machine (locally), it is incrementally updating the registry repo. On a docker image however, it is doing that from scratch. It is the act of pulling the registry that might be causing things to blow up.
The issue was solved by using the Cargo nightly sparse-registry feature. The feature will allow Cargo to access the crates.io index over HTTP, rather than git. It can provide a significant performance improvement.
Adding these commands in the Dockerfile was the solution :
RUN apt-get install curl -y RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain nightly -y ENV PATH=/root/.cargo/bin:$PATH
These commands installed curl and then used it to download and run the Rustup installer script, which installed Rust with the nightly toolchain. Finally, the PATH environment variable was updated to include the Rust executable path.
RUN rustup toolchain install nightly RUN cargo +nightly install -Z sparse-registry --debug cargo-ament-build RUN cargo build
This time, the build completed successfully without any errors.
Part of the solution was found here rust-lang/cargo#10781. In particular, the comments by epage and lexicalunit provided helpful guidance.
While building the Docker image (following the docker tutorial), an error occurred when running the command RUN cargo build, with an exit code of 137.
It looks like the process gets stuck on the "Updating crates.io index" step forever until the docker container runs out of memory and kills it.
The text was updated successfully, but these errors were encountered: