File tree Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Expand file tree Collapse file tree 2 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -16,19 +16,30 @@ COPY . .
1616RUN 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- 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
2320
2421RUN apt-get update && apt-get install -y \
2522 openssl \
2623 net-tools \
2724 git \
28- locales
25+ locales \
26+ sudo \
27+ dumb-init
28+
2929RUN locale-gen en_US.UTF-8
3030# We unfortunately cannot use update-locale because docker will not use the env variables
3131# configured in /etc/default/locale so we need to set it manually.
32- ENV LANG=en_US.UTF-8
3332ENV 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 99
1010Try it out:
1111``` 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
1313```
1414
1515- Code on your Chromebook, tablet, and laptop with a consistent dev environment.
You can’t perform that action at this time.
0 commit comments