Problem
Provide some special cargo env variables into the docker container crashes the script.
Background
I use custom CARGO_TARGET_DIR and CARGO_BUILD_TARGET_DIR variables that are responsible for target folder name that is target by default.
It is important to provide the variables to docker container as the project folder in mounted as volume and cargo shouldn't create additional target directory.
Solution
Use corresponding env variables when constructing paths to files.
Here optimize.sh#L42 change is needed: replace target with "$CARGO_TARGET_DIR".
Problem
Provide some special cargo env variables into the docker container crashes the script.
Background
I use custom
CARGO_TARGET_DIRandCARGO_BUILD_TARGET_DIRvariables that are responsible for target folder name that istargetby default.It is important to provide the variables to docker container as the project folder in mounted as volume and cargo shouldn't create additional
targetdirectory.Solution
Use corresponding env variables when constructing paths to files.
Here optimize.sh#L42 change is needed: replace
targetwith"$CARGO_TARGET_DIR".