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
ycai
simbricks
Commits
f682bce4
Commit
f682bce4
authored
May 26, 2022
by
Jonas Kaufmann
Committed by
Antoine Kaufmann
May 26, 2022
Browse files
devcontainer use non-root user
parent
deb8f128
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
.devcontainer.json
.devcontainer.json
+3
-2
docker/Dockerfile.buildenv
docker/Dockerfile.buildenv
+12
-0
No files found.
.devcontainer.json
View file @
f682bce4
...
...
@@ -5,5 +5,6 @@
],
"extensions"
:
[
"ms-python.python"
]
],
"remoteUser"
:
"simbricks"
}
docker/Dockerfile.buildenv
View file @
f682bce4
...
...
@@ -44,3 +44,15 @@ RUN cd /tmp \
&& make -j`nproc` \
&& make install \
&& rm -rf /tmp/verilator
# Add non-root user for vs code devcontainer.
ARG USERNAME=simbricks
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME --shell /bin/bash \
# Add sudo support for this user and remove the need to type in password.
&& apt-get update \
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME
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