增加用户名

This commit is contained in:
Aison 2024-02-08 10:15:54 +08:00
parent 6b1b9b98dc
commit 78d7cf8e95
No known key found for this signature in database
1 changed files with 7 additions and 4 deletions

View File

@ -1,6 +1,9 @@
FROM mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye
RUN id -u node &> /dev/null || useradd --groups sudo --no-create-home --shell /bin/bash node \
&& echo "node ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/node \
&& chmod 0440 /etc/sudoers.d/node
RUN sh -c "$(curl -fsSL https://starship.rs/install.sh)" -y -f && echo 'eval "$(starship init bash)"' >> /home/node/.bashrc
ARG USER=node
RUN id -u &> /dev/null || useradd --groups sudo --no-create-home --shell /bin/bash ${USER} \
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \
&& chmod 0440 /etc/sudoers.d/${USER}
RUN sh -c "$(curl -fsSL https://starship.rs/install.sh)" -y -f && echo 'eval "$(starship init bash)"' >> /home/${USER}/.bashrc
USER ${USER}
WORKDIR /home/${USER}
RUN npm install cnpm -g && cnpm install tsx rimraf @antfu/ni -g