Merge pull request #913 from thewtex/change-rustup-install

common: install rustup into /opt/rustup
This commit is contained in:
Matt McCormick
2025-10-10 21:58:52 -04:00
committed by GitHub
2 changed files with 5 additions and 7 deletions
+5
View File
@@ -18,6 +18,9 @@ ARG CURL_HASH=3b4378156ba09e224008e81dcce854b7ce4d182b1f9cfb97fe5ed9e9c18c6bd3
ARG PERL_VERSION=perl-5.40.1
ARG PERL_HASH=02f8c45bb379ed0c3de7514fad48c714fd46be8f0b536bfd5320050165a1ee26
ENV RUSTUP_HOME=/opt/rustup
ENV CARGO_HOME=/opt/rustup/cargo
# Image build scripts
COPY \
imagefiles/build-and-install-cmake.sh \
@@ -49,6 +52,8 @@ RUN \
/buildscripts/build-and-install-flatcc.sh && \
rm -rf /buildscripts
ENV PATH=/opt/rustup/cargo/bin:$PATH
RUN echo "root:root" | chpasswd
WORKDIR /work
ENTRYPOINT ["/dockcross/entrypoint.sh"]
-7
View File
@@ -32,13 +32,6 @@ if [[ -n $BUILDER_UID ]] && [[ -n $BUILDER_GID ]]; then
export HOME=/home/${BUILDER_USER}
shopt -s dotglob
# Move rustup/cargo directories as they are large, and not needed as root
if [[ -d /root/.rustup ]]; then
mv -t $HOME/ /root/.rustup
fi
if [[ -d /root/.cargo ]]; then
mv -t $HOME/ /root/.cargo
fi
# Copy the rest
cp -r /root/* $HOME/
chown -R $BUILDER_UID:$BUILDER_GID $HOME