osbuilder: Simplify Rust installation
no double export, direct target
@@ -210,17 +210,11 @@ generate_dockerfile()
# Rust agent
readonly install_rust="
-RUN curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSLf --output /tmp/rust-init; \
- chmod a+x /tmp/rust-init; \
- export http_proxy=${http_proxy:-}; \
- export https_proxy=${http_proxy:-}; \
- /tmp/rust-init -y --default-toolchain ${RUST_VERSION}
-RUN . /root/.cargo/env; \
- export http_proxy=${http_proxy:-}; \
- export https_proxy=${http_proxy:-}; \
- cargo install cargo-when; \
- rustup target install ${rustarch}-unknown-linux-${libc}
-RUN ln -sf /usr/bin/g++ /bin/musl-g++
+ENV http_proxy=${http_proxy:-}
+ENV https_proxy=${http_proxy:-}
+RUN curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSLf | \
+ sh -s -- -y --default-toolchain ${RUST_VERSION} -t ${rustarch}-unknown-linux-${LIBC}
+RUN . /root/.cargo/env; cargo install cargo-when
"
pushd "${dir}"
