fix: If the preferred username or uid is already taken, remove it.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
91787ff989
commit
a788ba9e6d
1 changed files with 3 additions and 1 deletions
|
@ -22,8 +22,10 @@ ENV LANGUAGE $LOCALE:en
|
|||
ENV LC_ALL $LOCALE.UTF-8
|
||||
|
||||
ARG USERNAME=vscode
|
||||
ARG USER_UID=1001
|
||||
ARG USER_UID=1000
|
||||
ARG USER_GID=$USER_UID
|
||||
RUN userdel -f -r `id -nu ${USER_UID}` || true
|
||||
RUN userdel -f -r ${USERNAME} || true
|
||||
RUN groupadd --gid ${USER_GID} ${USERNAME}
|
||||
RUN useradd --shell /usr/bin/zsh --uid ${USER_UID} --gid ${USER_GID} -m ${USERNAME}
|
||||
RUN mkdir /workspace && chown ${USERNAME}:${USERNAME} /workspace
|
||||
|
|
Loading…
Reference in a new issue