Open dmikushin opened 3 weeks ago
Please provide more detail, what does repeated download of rust-std
mean? Does it mean that it keeps downloading it many times in the same invocation, or does it mean that it always downloads the component on new invocation in a new container?
Are you using CROSS_CONTAINER_IN_CONTAINER=1
?
@Emilgardis , yes, in my outer Docker I do:
# Set CROSS_CONTAINER_IN_CONTAINER to inform `cross` that it is executed from within a container
ENV CROSS_CONTAINER_IN_CONTAINER=true
Then, I use this container to do:
COMMAND ${DOCKER_EXECUTABLE} run --rm -v "${CMAKE_CURRENT_SOURCE_DIR}/ThirdParty/${PROJECT_NAME}:/${PROJECT_NAME}" -v "${CMAKE_CURRENT_BINARY_DIR}/target:/${PROJECT_NAME}/target" -w "/${PROJECT_NAME}" -v /var/run/docker.sock:/var/run/docker.sock ${PROJECT_NAME} cross build --release --target=aarch64-unknown-linux-gnu
Important note: I execute docker run
again and again to rebuild the Rust project during my development. And each time I rebuild, I see that:
info: downloading component 'rust-std' for 'aarch64-unknown-linux-gnu'
info: installing component 'rust-std' for 'aarch64-unknown-linux-gnu'
My connection is rather fast, but I still experience additional delay from this "rust-std" every time, and I think it could be removed. I think it could be done by mounting the host folder into the outer docker, and then by mounting the same folder down into the cross container. Please tell me what commands and paths I should use.
im a bit confused, is this in a docker build
? what does COMMAND ${DOCKER_EXECUTABLE}
mean?
Are you using cross from the main branch?
This is CMake, here. I build CMake rules to automate the build process, so that it could fit anywhere that could run CMake, for example into VSCode. It is not relevant to this question.
I kindly ask you to return back to the plot: the cross container is not able to avoid repeated download of rust-std package. There must be an instruction from your side to cache rust-std when cross is launched in CROSS_CONTAINER_IN_CONTAINER
mode.
Are you using cross from the main branch?
I install cross here, this way:
RUN cargo install cross --git https://github.com/cross-rs/cross
Ok thank you, I think i have the full context now. Try making RUSTUP_HOME
persistant with a volume. /usr/local/rustup
When running cross-rs from within another Docker container, please provide a clear instruction how to avoid repeated download of rust-std: