Create /workspaces in the devcontainer for the dev user
Folders next to the project, like a clone of another repository, can be created without root. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4a159006aa
commit
fc1463c290
1 file changed
+4
@@ -27,6 +27,10 @@ RUN groupadd --gid $USER_GID $USERNAME && \
|
||||
echo "$USERNAME ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/$USERNAME && \
|
||||
chmod 0440 /etc/sudoers.d/$USERNAME
|
||||
|
||||
# Owned by the dev user so folders can be created next to the project. Docker
|
||||
# would otherwise create it as root when bind mounting /workspaces/max.
|
||||
RUN mkdir /workspaces && chown $USERNAME:$USERNAME /workspaces
|
||||
|
||||
# Project venv, owned by the dev user so pip works without sudo
|
||||
ENV VIRTUAL_ENV=/opt/venv
|
||||
RUN python -m venv $VIRTUAL_ENV && chown -R $USERNAME:$USERNAME $VIRTUAL_ENV
|
||||
|
||||
Reference in new issue
Block a user