|
1 | | -FROM node:10.15.1 |
| 1 | +FROM codercom/code-server |
2 | 2 |
|
3 | | -# Install VS Code's deps. These are the only two it seems we need. |
4 | | -RUN apt-get update && apt-get install -y \ |
5 | | - libxkbfile-dev \ |
6 | | - libsecret-1-dev |
| 3 | +RUN sudo apt-get update && sudo apt-get -y install \ |
| 4 | + apt-transport-https \ |
| 5 | + ca-certificates \ |
| 6 | + curl \ |
| 7 | + gnupg-agent \ |
| 8 | + software-properties-common |
7 | 9 |
|
8 | | -# Ensure latest yarn. |
9 | | -RUN npm install -g [email protected] |
| 10 | +RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - |
10 | 11 |
|
11 | | -WORKDIR /src |
12 | | -COPY . . |
| 12 | +RUN sudo apt-key fingerprint 0EBFCD88 && sudo add-apt-repository \ |
| 13 | + "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ |
| 14 | + $(lsb_release -cs) \ |
| 15 | + stable" |
13 | 16 |
|
14 | | -# In the future, we can use https://github.com/yarnpkg/rfcs/pull/53 to make yarn use the node_modules |
15 | | -# directly which should be fast as it is slow because it populates its own cache every time. |
16 | | -RUN yarn && NODE_ENV=production yarn task build:server:binary |
| 17 | +RUN sudo apt-get update && sudo apt-get install -y docker-ce-cli |
17 | 18 |
|
18 | | -# We deploy with ubuntu so that devs have a familiar environment. |
19 | | -FROM ubuntu:18.04 |
| 19 | +USER root |
20 | 20 |
|
21 | | -RUN apt-get update && apt-get install -y \ |
22 | | - openssl \ |
23 | | - net-tools \ |
24 | | - git \ |
25 | | - locales \ |
26 | | - sudo \ |
27 | | - dumb-init \ |
28 | | - vim \ |
29 | | - curl \ |
30 | | - wget |
| 21 | +WORKDIR /projects |
31 | 22 |
|
32 | | -RUN locale-gen en_US.UTF-8 |
33 | | -# We unfortunately cannot use update-locale because docker will not use the env variables |
34 | | -# configured in /etc/default/locale so we need to set it manually. |
35 | | -ENV LC_ALL=en_US.UTF-8 |
| 23 | +VOLUME /var/run/docker.sock |
| 24 | +VOLUME /projects |
36 | 25 |
|
37 | | -RUN adduser --gecos '' --disabled-password coder && \ |
38 | | - echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd |
39 | | - |
40 | | -USER coder |
41 | | -# We create first instead of just using WORKDIR as when WORKDIR creates, the user is root. |
42 | | -RUN mkdir -p /home/coder/project |
43 | | - |
44 | | -WORKDIR /home/coder/project |
45 | | - |
46 | | -# This assures we have a volume mounted even if the user forgot to do bind mount. |
47 | | -# So that they do not lose their data if they delete the container. |
48 | | -VOLUME [ "/home/coder/project" ] |
49 | | - |
50 | | -COPY --from=0 /src/packages/server/cli-linux-x64 /usr/local/bin/code-server |
51 | | -EXPOSE 8443 |
52 | | - |
53 | | -ENTRYPOINT ["dumb-init", "code-server"] |
| 26 | +ENV color_prompt yes |
0 commit comments