1
- FROM node:10.15.1
1
+ FROM node:10.16.0
2
+ ARG codeServerVersion=docker
3
+ ARG vscodeVersion
2
4
3
5
# Install VS Code's deps. These are the only two it seems we need.
4
6
RUN apt-get update && apt-get install -y \
@@ -11,9 +13,14 @@ RUN npm install -g yarn@1.13
11
13
WORKDIR /src
12
14
COPY . .
13
15
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
16
+
17
+ # In the future, we can use https://github.com/yarnpkg/rfcs/pull/53 to make
18
+ # yarn use the node_modules directly which should be fast as it is slow because
19
+ # it populates its own cache every time.
20
+ RUN yarn \
21
+ && yarn build "${codeServerVersion}" "${vscodeVersion}" linux x64 \
22
+ && yarn binary "${codeServerVersion}" "${vscodeVersion}" linux x64 \
23
+ && mv "/src/build/code-server${codeServerVersion}-vsc${vscodeVersion}-linux-x64" /src/build/code-server
17
24
18
25
# We deploy with ubuntu so that devs have a familiar environment.
19
26
FROM ubuntu:18.04
@@ -30,24 +37,26 @@ RUN apt-get update && apt-get install -y \
30
37
wget
31
38
32
39
RUN locale-gen en_US.UTF-8
33
- # We unfortunately cannot use update-locale because docker will not use the env variables
40
+ # We cannot use update-locale because docker will not use the env variables
34
41
# configured in /etc/default/locale so we need to set it manually.
35
42
ENV LC_ALL=en_US.UTF-8
36
43
37
44
RUN adduser --gecos '' --disabled-password coder && \
38
45
echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
39
46
40
47
USER coder
41
- # We create first instead of just using WORKDIR as when WORKDIR creates, the user is root.
48
+ # We create first instead of just using WORKDIR as when WORKDIR creates, the
49
+ # user is root.
42
50
RUN mkdir -p /home/coder/project
43
51
44
52
WORKDIR /home/coder/project
45
53
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.
54
+ # This ensures we have a volume mounted even if the user forgot to do bind
55
+ # mount. So that they do not lose their data if they delete the container.
48
56
VOLUME [ "/home/coder/project" ]
49
57
50
- COPY --from=0 /src/packages/server/cli-linux-x64 /usr/local/bin/code-server
58
+ COPY --from=0 /src/build/code-server /usr/local/bin/code-server
51
59
EXPOSE 8443
60
+ EXPOSE 8444
52
61
53
- ENTRYPOINT ["dumb-init" , "code-server" ]
62
+ ENTRYPOINT ["dumb-init" , "code-server" , "--host" , "0.0.0.0" ]
0 commit comments