fix: 优化Dockerfile,简化用户添加步骤,移除不必要的groupadd和useradd命令

This commit is contained in:
2025-09-17 13:22:43 +08:00
parent b80d41c637
commit ea5b5adbfa

View File

@@ -24,9 +24,7 @@ RUN apt-get update \
&& apt-get install -y python2 python-mako python-is-python2 python-enum34 gettext && apt-get install -y python2 python-mako python-is-python2 python-enum34 gettext
RUN groupadd -g $groupid $username \ RUN echo "$username ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \
&& useradd -m -u $userid -g $groupid $username \
&& echo "$username ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers \
&& echo $username >/root/username \ && echo $username >/root/username \
&& echo "$username:$username" | chpasswd && adduser $username sudo && echo "$username:$username" | chpasswd && adduser $username sudo