fix: If the preferred username or uid is already taken, remove it.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
James Harton 2024-06-21 16:08:57 +12:00
parent 91787ff989
commit a788ba9e6d
Signed by: james
GPG key ID: 90E82DAA13F624F4

View file

@ -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