Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion images/universal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

## Description

Microsoft's [Universal Dev Container Image](https://github.com/devcontainers/images/tree/main/src/universal) extended with a `coder` user.
Microsoft's [Universal Dev Container Image](https://github.com/devcontainers/images/tree/main/src/universal) with the upstream `codespace` user renamed to `coder` so the base image's home directory and shell environment are preserved.
16 changes: 7 additions & 9 deletions images/universal/ubuntu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ RUN rm -R /opt/conda && \
# Install Chrome for AI Browser Testing
RUN yes | npx playwright install chrome

# Create `coder` user
RUN userdel -r codespace && \
useradd coder \
--create-home \
--shell=/bin/bash \
--groups=docker \
--uid=1000 \
--user-group && \
echo "coder ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers.d/nopasswd
# Rename the upstream `codespace` user to `coder` so we preserve the
# existing home directory and shell environment provided by the base image.
RUN usermod -l coder codespace && \
groupmod -n coder codespace && \
usermod -d /home/coder -m coder && \
usermod -aG docker,sudo coder && \
echo "coder ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers.d/nopasswd

USER coder
Loading