Skip to content

Commit f973431

Browse files
Xiao-TaoMingtao Zhou
andauthored
fix(loong64): address "The GID `1000' is already in use" error. (#186)
If the group/user with the specified GID/UID already exists, it will be changed to node:node. similar to recipes/riscv64/Dockerfile. Co-authored-by: Mingtao Zhou <[email protected]>
1 parent 906a619 commit f973431

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

recipes/loong64/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ RUN apt-get update \
2222
gcc-14-loongarch64-linux-gnu-base \
2323
gcc-14-loongarch64-linux-gnu
2424

25-
RUN addgroup --gid $GID node \
26-
&& adduser --gid $GID --uid $UID --disabled-password --gecos node node
25+
RUN (addgroup --gid $GID node || groupmod -n node $(getent group $GID | cut -d: -f1)) \
26+
&& (adduser --gid $GID --uid $UID --disabled-password --gecos "" node || usermod -l node -g $GID -d /home/node -m $(getent passwd $UID | cut -d: -f1))
2727

2828
RUN rm -f /usr/bin/python3
2929
RUN ln -s /usr/bin/python3.10 /usr/bin/python3

recipes/loong64/should-build.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ fullversion=$2
77

88
decode "$fullversion"
99

10-
(test "$major" -eq "18" && test "$minor" -ge "18") || \
1110
(test "$major" -eq "20" && test "$minor" -ge "10") || \
1211
(test "$major" -eq "21") || \
1312
(test "$major" -eq "22" && test "$minor" -ge "14") || \
14-
(test "$major" -eq "23")
13+
(test "$major" -ge "23")

0 commit comments

Comments
 (0)