JarodMica / ai-voice-cloning

GNU General Public License v3.0
430 stars 87 forks source link

The command '/bin/sh -c groupadd --gid $GID user' returned a non-zero code: 4 #119

Open ethanfel opened 1 month ago

ethanfel commented 1 month ago

hello, Using the Linux docker, running the setup-docker.sh

Step 11/48 : RUN groupadd --gid $GID user ---> Running in 3efa27e26494 groupadd: GID '0' already exists The command '/bin/sh -c groupadd --gid $GID user' returned a non-zero code: 4

ethanfel commented 1 month ago

I was able to workaround it by swapping $GID and $UID in the docker file using 1000

hongjiang11 commented 1 week ago

try

User

RUN if getent group $GID; then \ GID=$(($(getent group | awk -F: '{if ($3>=1000) print $3}' | sort -n | tail -1) + 1)); \ fi && \ groupadd --gid $GID user RUN if ! getent passwd $UID; then \ useradd --no-log-init --create-home --shell /bin/bash --uid $UID --gid $GID user; \ else \ UID=$(($(getent passwd | awk -F: '{if ($3>=1000) print $3}' | sort -n | tail -1) + 1)); \ useradd --no-log-init --create-home --shell /bin/bash --uid $UID --gid $GID user; \ fi USER user ENV HOME=/home/user WORKDIR $HOME RUN mkdir $HOME/.cache $HOME/.config && chmod -R 777 $HOME