mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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.
This commit is contained in:
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user