imagefiles/entrypoint.sh: Move rust/cargo directories

Presumably we do not need those as root.
This commit is contained in:
Nicolas Boichat
2025-05-28 15:31:51 +02:00
parent 494c154b87
commit 27e0cf6c78

View File

@ -28,6 +28,9 @@ if [[ -n $BUILDER_UID ]] && [[ -n $BUILDER_GID ]]; then
useradd -o -m -g "$BUILDER_GID" -u "$BUILDER_UID" "$BUILDER_USER" 2> /dev/null
export HOME=/home/${BUILDER_USER}
shopt -s dotglob
# Move rustup/cargo directories as they are large, and not needed as root
mv -t $HOME/ /root/.rustup /root/.cargo
# Copy the rest
cp -r /root/* $HOME/
chown -R $BUILDER_UID:$BUILDER_GID $HOME