File tree 2 files changed +19
-8
lines changed
2 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -16,19 +16,30 @@ COPY . .
16
16
RUN yarn && NODE_ENV=production yarn task build:server:binary
17
17
18
18
# We deploy with ubuntu so that devs have a familiar environment.
19
- 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
19
+ FROM ubuntu:18.04
23
20
24
21
RUN apt-get update && apt-get install -y \
25
22
openssl \
26
23
net-tools \
27
24
git \
28
- locales
25
+ locales \
26
+ sudo \
27
+ dumb-init
28
+
29
29
RUN locale-gen en_US.UTF-8
30
30
# We unfortunately cannot use update-locale because docker will not use the env variables
31
31
# configured in /etc/default/locale so we need to set it manually.
32
- ENV LANG=en_US.UTF-8
33
32
ENV LC_ALL=en_US.UTF-8
34
- ENTRYPOINT ["code-server" ]
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" ]
Original file line number Diff line number Diff line change 9
9
10
10
Try it out:
11
11
``` bash
12
- docker run -t -p 127.0.0.1:8443:8443 -v " ${PWD} :/root/ project" codercom/code-server code-server --allow-http --no-auth
12
+ docker run -it -p 127.0.0.1:8443:8443 -v " ${PWD} :/home/coder/ project" codercom/code-server:1.621 --allow-http --no-auth
13
13
```
14
14
15
15
- Code on your Chromebook, tablet, and laptop with a consistent dev environment.
You can’t perform that action at this time.
0 commit comments