@@ -16,9 +16,7 @@ WORKDIR /gp-code
16
16
RUN yarn --cwd remote --frozen-lockfile --network-timeout 180000
17
17
18
18
19
- FROM gitpod/openvscode-server-linux-build-agent:bionic-x64 as code_installer
20
-
21
- USER root
19
+ FROM gitpod/openvscode-server-linux-build-agent:bionic-x64 as code_builder
22
20
23
21
ARG CODE_COMMIT
24
22
@@ -40,12 +38,15 @@ RUN mkdir /gp-code \
40
38
&& git fetch origin $CODE_COMMIT --depth=1 \
41
39
&& git reset --hard FETCH_HEAD
42
40
WORKDIR /gp-code
43
- RUN yarn --frozen-lockfile --network-timeout 180000 \
44
- && yarn --cwd remote/web --frozen-lockfile --network-timeout 180000 \
45
- && yarn --cwd extensions compile \
41
+ RUN yarn --frozen-lockfile --network-timeout 180000
42
+
43
+ # copy remote dependencies build in dependencies_builder image
44
+ RUN rm -rf remote/node_modules/
45
+ COPY --from=dependencies_builder /gp-code/remote/node_modules/ /gp-code/remote/node_modules/
46
+
47
+ RUN yarn --cwd extensions compile \
46
48
&& yarn gulp vscode-web-min \
47
49
&& yarn gulp vscode-reh-linux-x64-min
48
- COPY --from=dependencies_builder /gp-code/remote/node_modules/ /vscode-reh-linux-x64/node_modules/
49
50
50
51
# config for first layer needed by blobserve
51
52
# we also remove `static/` from resource urls as that's needed by blobserve,
@@ -62,13 +63,14 @@ RUN chmod -R ugo+x /ide/bin
62
63
# grant write permissions for built-in extensions
63
64
RUN chmod -R ugo+w /vscode-reh-linux-x64/extensions
64
65
66
+
65
67
FROM scratch
66
68
# copy static web resources in first layer to serve from blobserve
67
- COPY --from=code_installer --chown=33333:33333 /vscode-web/ /ide/
68
- COPY --from=code_installer --chown=33333:33333 /vscode-reh-linux-x64/ /ide/
69
+ COPY --from=code_builder --chown=33333:33333 /vscode-web/ /ide/
70
+ COPY --from=code_builder --chown=33333:33333 /vscode-reh-linux-x64/ /ide/
69
71
COPY --chown=33333:33333 startup.sh supervisor-ide-config.json /ide/
70
72
71
- COPY --from=code_installer --chown=33333:33333 /ide/bin /ide/bin/remote-cli
73
+ COPY --from=code_builder --chown=33333:33333 /ide/bin /ide/bin/remote-cli
72
74
73
75
ENV GITPOD_ENV_APPEND_PATH /ide/bin/remote-cli:
74
76
0 commit comments