Skip to content

Commit 2349305

Browse files
committed
Refactor to use upstream Dockerfile
Signed-off-by: Steve Sloka <[email protected]>
1 parent 926eae9 commit 2349305

File tree

2 files changed

+33
-12
lines changed

2 files changed

+33
-12
lines changed

deployment/Dockerfile

+32-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,34 @@
1-
FROM golang:stretch
2-
WORKDIR /app
3-
RUN apt-get update \
4-
&& apt-get install -y wget net-tools vim rsync \
5-
&& rm -rf /var/lib/apt/lists/*
6-
RUN wget https://github.com/$(wget https://github.com/codercom/code-server/releases/latest -O - | egrep '/.*/.*-linux.tar.gz' -o) \
7-
&& tar -xvzf * \
8-
&& cd * \
9-
&& chmod +x code-server \
10-
&& mv ./code-server /
1+
FROM node:8.15.0
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
7+
8+
# Ensure latest yarn.
9+
RUN npm install -g [email protected]
1110

11+
WORKDIR /src
12+
COPY . .
13+
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 && yarn task build:server:binary
17+
18+
# Use golang base dev for go development tooling
19+
FROM golang:stretch
20+
WORKDIR /root/project
21+
COPY --from=0 /src/packages/server/cli-linux-x64 /usr/local/bin/code-server
1222
EXPOSE 8443
13-
CMD /code-server -p 8443
23+
RUN apt-get update && apt-get install -y \
24+
openssl \
25+
net-tools \
26+
vim \
27+
rsync
28+
RUN apt-get install -y locales && \
29+
locale-gen en_US.UTF-8
30+
# We unfortunately cannot use update-locale because docker will not use the env variables
31+
# configured in /etc/default/locale so we need to set it manually.
32+
ENV LANG=en_US.UTF-8
33+
# Unfortunately `.` does not work with code-server.
34+
CMD code-server $PWD

deployment/deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ spec:
6161
- image: stevesloka/code-server
6262
imagePullPolicy: Always
6363
name: code-server
64-
command: ["/code-server"]
64+
command: ["code-server"]
6565
args:
6666
- /go/src
6767
- --allow-http

0 commit comments

Comments
 (0)