From 78d7cf8e951aabdcb4c4f7413df2aa2d54cd8cd2 Mon Sep 17 00:00:00 2001 From: Aison Date: Thu, 8 Feb 2024 10:15:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=A8=E6=88=B7=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .devcontainer/Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 5a12c2d..2f37b17 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -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 \ No newline at end of file