From f77ef65b477d1e26b6b309fbfccc69ecfa4f3a9c Mon Sep 17 00:00:00 2001 From: Mingtao Zhou Date: Tue, 2 Sep 2025 11:28:31 +0800 Subject: [PATCH] [loong64] Fixed the "The GID `1000' is already in use" error. If the group/user with the specified GID/UID already exists, it will be changed to node:node. similar to recipes/riscv64/Dockerfile. --- recipes/loong64/Dockerfile | 4 ++-- recipes/loong64/should-build.sh | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/recipes/loong64/Dockerfile b/recipes/loong64/Dockerfile index 9fd9aad..5a62e4b 100644 --- a/recipes/loong64/Dockerfile +++ b/recipes/loong64/Dockerfile @@ -22,8 +22,8 @@ RUN apt-get update \ gcc-14-loongarch64-linux-gnu-base \ gcc-14-loongarch64-linux-gnu -RUN addgroup --gid $GID node \ - && adduser --gid $GID --uid $UID --disabled-password --gecos node node +RUN (addgroup --gid $GID node || groupmod -n node $(getent group $GID | cut -d: -f1)) \ + && (adduser --gid $GID --uid $UID --disabled-password --gecos "" node || usermod -l node -g $GID -d /home/node -m $(getent passwd $UID | cut -d: -f1)) RUN rm -f /usr/bin/python3 RUN ln -s /usr/bin/python3.10 /usr/bin/python3 diff --git a/recipes/loong64/should-build.sh b/recipes/loong64/should-build.sh index f4952b1..c4ca633 100755 --- a/recipes/loong64/should-build.sh +++ b/recipes/loong64/should-build.sh @@ -7,8 +7,7 @@ fullversion=$2 decode "$fullversion" -(test "$major" -eq "18" && test "$minor" -ge "18") || \ (test "$major" -eq "20" && test "$minor" -ge "10") || \ (test "$major" -eq "21") || \ (test "$major" -eq "22" && test "$minor" -ge "14") || \ -(test "$major" -eq "23") +(test "$major" -ge "23")