Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
zhaoyu6
sglang
Commits
c0bf9bf1
Unverified
Commit
c0bf9bf1
authored
Jan 22, 2025
by
Byron Hsu
Committed by
GitHub
Jan 22, 2025
Browse files
[devcontainer] add non-root user (#2989)
parent
022614d2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
7 deletions
+37
-7
.devcontainer/Dockerfile
.devcontainer/Dockerfile
+35
-0
.devcontainer/devcontainer.json
.devcontainer/devcontainer.json
+2
-1
docker/Dockerfile.dev
docker/Dockerfile.dev
+0
-6
No files found.
.devcontainer/Dockerfile
0 → 100644
View file @
c0bf9bf1
From
lmsysorg/sglang:dev
# Create non-root user with specified UID and GID
# NOTE: Replace with your own UID and GID. This is a workaround from https://github.com/microsoft/vscode-remote-release/issues/49#issuecomment-489060908.
ARG
HOST_UID=1003
ARG
HOST_GID=1003
RUN
groupadd
-g
$HOST_GID
devuser
&&
\
useradd
-m
-u
$HOST_UID
-g
$HOST_GID
-s
/bin/zsh devuser
# Give devuser sudo access
RUN
apt-get update
&&
apt-get
install
-y
sudo
&&
\
echo
"devuser ALL=(ALL) NOPASSWD:ALL"
>
/etc/sudoers.d/devuser
&&
\
rm
-rf
/var/lib/apt/lists/
*
&&
\
apt-get clean
# Set up oh-my-zsh for devuser
RUN
cp
-r
/root/.oh-my-zsh /home/devuser/.oh-my-zsh
&&
\
cp
/root/.zshrc /home/devuser/.zshrc
&&
\
cp
/root/.vimrc /home/devuser/.vimrc
&&
\
cp
/root/.tmux.conf /home/devuser/.tmux.conf
&&
\
sed
-i
's|/root/.oh-my-zsh|/home/devuser/.oh-my-zsh|g'
/home/devuser/.zshrc
&&
\
chown
-R
devuser:devuser /home/devuser/
# Set workspace directory and ownership
WORKDIR
/sgl-workspace/sglang
RUN
chown
-R
devuser:devuser /sgl-workspace
# Switch to devuser
USER
devuser
# Install uv
RUN
curl
-LsSf
https://astral.sh/uv/install.sh | sh
# Install rust
RUN
curl
--proto
'=https'
--tlsv1
.2
-sSf
https://sh.rustup.rs | sh
-s
--
-y
.devcontainer/devcontainer.json
View file @
c0bf9bf1
{
"name"
:
"sglang"
,
"build"
:
{
"dockerfile"
:
"
../docker/
Dockerfile
.dev
"
"dockerfile"
:
"Dockerfile"
},
"remoteUser"
:
"devuser"
,
"customizations"
:
{
"vscode"
:
{
"extensions"
:
[
...
...
docker/Dockerfile.dev
View file @
c0bf9bf1
...
...
@@ -67,12 +67,6 @@ RUN wget https://github.com/Kitware/CMake/releases/download/v3.31.1/cmake-3.31.1
&& cp -r cmake-3.31.1-linux-x86_64/share/* /usr/local/share/ \
&& rm -rf cmake-3.31.1-linux-x86_64 cmake-3.31.1-linux-x86_64.tar.gz
# Install uv
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
# Install rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# Add yank script
COPY --chown=root:root <<-"EOF" /usr/local/bin/yank
#!/bin/bash
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment