-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Improve docker example first user experience (#4972)
The base ubuntu image lands the user as root, but the terraform tempalte expected /home/coder to be used. This change adds a user with the same name as the Coder users username and allows them to sudo.
- Loading branch information
Showing
2 changed files
with
25 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
FROM ubuntu | ||
|
||
RUN apt-get update && apt-get install -y curl wget git vim golang | ||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
curl \ | ||
git \ | ||
golang \ | ||
sudo \ | ||
vim \ | ||
wget \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ARG USER=coder | ||
RUN useradd --groups sudo --no-create-home ${USER} \ | ||
&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/${USER} \ | ||
&& chmod 0440 /etc/sudoers.d/${USER} | ||
USER ${USER} | ||
WORKDIR /home/${USER} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters