Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 54cf52c

Browse filesBrowse files
committed
Significantly improve the Dockerfile
- Adds dumb-init so closes #403, closes #361, closes #383 - User mode docker so closes #192, closes #65 - Uses latest docker ubuntu instead of 18.10 which is the rolling tag so closes #404 Thanks to @RichardMcSorley and @sr229
1 parent 455f13c commit 54cf52c
Copy full SHA for 54cf52c

File tree

Expand file treeCollapse file tree

1 file changed

+17
-9
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+17
-9
lines changed
Open diff view settings
Collapse file

‎Dockerfile‎

Copy file name to clipboardExpand all lines: Dockerfile
+17-9Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,30 @@ COPY . .
1616
RUN yarn && NODE_ENV=production yarn task build:server:binary
1717

1818
# We deploy with ubuntu so that devs have a familiar environment.
19-
FROM ubuntu:18.10
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;
19+
FROM ubuntu:18.04
2420

25-
COPY --from=0 /src/packages/server/cli-linux-x64 /usr/local/bin/code-server
2621
RUN apt-get update && apt-get install -y \
2722
openssl \
2823
net-tools \
2924
git \
3025
locales \
26+
sudo \
3127
dumb-init
28+
3229
RUN locale-gen en_US.UTF-8
3330
# We unfortunately cannot use update-locale because docker will not use the env variables
3431
# configured in /etc/default/locale so we need to set it manually.
35-
ENV LANG=en_US.UTF-8
36-
ENV LC_ALL=en_US.UTF-8
37-
ENTRYPOINT ["/usr/bin/dumb-init", "code-server"]
32+
ENV LC_ALL=en_US.UTF-8
33+
34+
RUN adduser --gecos '' --disabled-password coder
35+
RUN echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
36+
37+
USER coder
38+
# We create first instead of just using WORKDIR as when WORKDIR creates, the user is root.
39+
RUN mkdir -p /home/coder/project
40+
WORKDIR /home/coder/project
41+
42+
COPY --from=0 /src/packages/server/cli-linux-x64 /usr/local/bin/code-server
43+
EXPOSE 8443
44+
45+
ENTRYPOINT ["dumb-init", "code-server"]

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.