Skip to content

Commit b5e0a66

Browse files
author
Hikari
committed
feat: user-mode docker
Signed-off-by: Hikari <enra@sayonika.moe>
1 parent 60937c6 commit b5e0a66

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

Dockerfile

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,28 @@ RUN yarn && yarn task build:server:binary
1717

1818
# We deploy with ubuntu so that devs have a familiar environment.
1919
FROM ubuntu:18.10
20-
WORKDIR /root/project
21-
COPY --from=0 /src/packages/server/cli-linux-x64 /usr/local/bin/code-server
22-
EXPOSE 8443
23-
RUN apt-get update && apt-get install -y \
24-
openssl \
25-
net-tools
26-
RUN apt-get install -y locales && \
27-
locale-gen en_US.UTF-8
20+
2821
# We unfortunately cannot use update-locale because docker will not use the env variables
2922
# configured in /etc/default/locale so we need to set it manually.
3023
ENV LANG=en_US.UTF-8
24+
25+
COPY --from=0 /src/packages/server/cli-linux-x64 /usr/local/bin/code-server
26+
RUN apt-get update && apt-get install -y \
27+
sudo \
28+
openssl \
29+
locales \
30+
net-tools && \
31+
adduser --disabled-password --ingroup sudo --gecos '' coder && \
32+
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
33+
echo "user ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/user && \
34+
chmod 0440 /etc/sudoers.d/user;
35+
36+
RUN locale-gen en_US.UTF-8
37+
38+
USER coder
39+
40+
WORKDIR /home/coder
41+
42+
EXPOSE 8443
3143
ENTRYPOINT code-server
3244
CMD ["."]

0 commit comments

Comments
 (0)