-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
76 lines (50 loc) · 1.49 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
## -------------------------
## Base image for all builds
FROM alpine AS base
ENV THEIA_DIR=/opt/theia
WORKDIR ${THEIA_DIR}
## ----------------------------
## Build all packages for Theia
FROM base AS build
RUN apk add --no-cache \
build-base \
git \
libsecret-dev \
patch \
python \
yarn
ADD client/theia/package.json client/theia/plugin-ext.patch ./
# build Theia
RUN yarn global add node-gyp
RUN yarn
RUN patch -p0 -N < plugin-ext.patch
RUN export NODE_OPTIONS=--max_old_space_size=2048 && \
yarn theia build
RUN mkdir plugins
# helper script for VSCode plugin packaging
RUN yarn global add vsce
ADD scripts/vsce-package.sh /tmp/
# Docker syntax highlighter plugin
RUN git clone --depth 1 https://github.com/microsoft/vscode /vscode
WORKDIR /vscode/extensions/docker
RUN /tmp/vsce-package.sh
## ----------------------------------
## Copy packages into the final image
FROM base
ENV USER=theia \
THEIA_PLUGINS=local-dir:plugins,vscode:extension/broadinstitute.wdl-devtools
# vscode:extension/ms-azuretools.vscode-docker
RUN apk add --no-cache \
docker \
git \
libsecret \
python3 \
yarn \
&& \
adduser -S ${USER} && \
mkdir /home/${USER}/workspace
COPY --from=koalaman/shellcheck-alpine /bin/shellcheck /usr/local/bin/
COPY --from=build ${THEIA_DIR} .
USER ${USER}
ADD client/theia/settings.json /home/${USER}/.theia/
ENTRYPOINT ["yarn", "theia", "start", "/home/theia/workspace", "--hostname=0.0.0.0"]