Skip to content

Commit be1a7b9

Browse files
committed
Merge remote-tracking branch 'sr229/docker-user' into docker-fixes
2 parents 5a1eb85 + 0c96ddb commit be1a7b9

File tree

1 file changed

+21
-7
lines changed

1 file changed

+21
-7
lines changed

Dockerfile

+21-7
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,32 @@ RUN yarn && NODE_ENV=production 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
20+
# We unfortunately cannot use update-locale because docker will not use the env variables
21+
# configured in /etc/default/locale so we need to set it manually.
22+
ENV LANG=en_US.UTF-8 \
23+
LC_ALL=en_US.UTF-8;
2324

25+
COPY --from=0 /src/packages/server/cli-linux-x64 /usr/local/bin/code-server
2426
RUN apt-get update && apt-get install -y \
25-
openssl \
26-
net-tools \
27-
git \
28-
locales
27+
sudo \
28+
openssl \
29+
locales \
30+
net-tools;
31+
32+
RUN adduser --disabled-password --ingroup sudo --gecos '' coder && \
33+
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers && \
34+
echo "user ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/user && \
35+
chmod 0440 /etc/sudoers.d/user;
36+
2937
RUN locale-gen en_US.UTF-8
3038
# We unfortunately cannot use update-locale because docker will not use the env variables
3139
# configured in /etc/default/locale so we need to set it manually.
3240
ENV LANG=en_US.UTF-8
3341
ENV LC_ALL=en_US.UTF-8
42+
43+
USER coder
44+
45+
WORKDIR /home/coder
46+
47+
EXPOSE 8443
3448
ENTRYPOINT ["code-server"]

0 commit comments

Comments
 (0)