1
- # Copyright (c) 2020 Gitpod GmbH. All rights reserved.
1
+ # Copyright (c) 2024 Gitpod GmbH. All rights reserved.
2
2
# Licensed under the GNU Affero General Public License (AGPL).
3
3
# See License.AGPL.txt in the project root for license information.
4
- FROM gitpod/openvscode-server-linux-build-agent:focal-x64 as code_builder
4
+ FROM gitpod/openvscode-server-linux-build-agent:centos7-devtoolset8-x64 as dependencies_builder
5
+
6
+ ENV TRIGGER_REBUILD 1
7
+
8
+ ARG CODE_COMMIT
9
+
10
+ RUN mkdir /gp-code \
11
+ && cd /gp-code \
12
+ && git init \
13
+ && git remote add origin https://github.com/gitpod-io/openvscode-server \
14
+ && git fetch origin $CODE_COMMIT --depth=1 \
15
+ && git reset --hard FETCH_HEAD
16
+ WORKDIR /gp-code/remote
17
+
18
+ RUN npm ci
19
+
20
+ FROM ubuntu:22.04 as code_builder
21
+
22
+ ARG DEBIAN_FRONTEND=noninteractive
5
23
6
24
ENV TRIGGER_REBUILD 1
7
25
8
26
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
9
27
ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1
10
28
ENV VSCODE_ARCH=x64
11
29
ENV NPM_REGISTRY=https://registry.npmjs.org
30
+ ENV NODE_VERSION=20
12
31
13
32
ARG CODE_COMMIT
14
33
ARG CODE_QUALITY
15
34
ARG CODE_VERSION
16
35
36
+ # Latest stable git
37
+ RUN apt-get update && apt-get install -y software-properties-common
38
+ RUN add-apt-repository ppa:git-core/ppa -y
39
+
40
+ RUN apt-get update && apt-get install -y \
41
+ apt-transport-https \
42
+ ca-certificates \
43
+ curl \
44
+ file \
45
+ git \
46
+ gnome-keyring \
47
+ iproute2 \
48
+ libfuse2 \
49
+ libgconf-2-4 \
50
+ libgdk-pixbuf2.0-0 \
51
+ libgl1 \
52
+ libgtk-3.0 \
53
+ libsecret-1-dev \
54
+ libssl-dev \
55
+ libx11-dev \
56
+ libx11-xcb-dev \
57
+ libxkbfile-dev \
58
+ locales \
59
+ lsb-release \
60
+ lsof \
61
+ python3-pip \
62
+ sudo \
63
+ wget \
64
+ xvfb \
65
+ tzdata \
66
+ unzip \
67
+ jq
68
+
69
+ # Set python3 as default
70
+ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
71
+ RUN python --version
72
+
73
+ # Check compiler toolchain
74
+ RUN gcc --version
75
+ RUN g++ --version
76
+
17
77
RUN sudo mkdir -m 0755 -p /etc/apt/keyrings
18
78
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
19
79
20
- RUN if dpkg --compare-versions "$CODE_VERSION" "ge" "1.90" ; then \
21
- NODE_VERSION=20; \
22
- else \
23
- NODE_VERSION=18; \
24
- fi && \
25
- echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_VERSION.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
80
+ RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_VERSION.x nodistro main" | sudo tee /etc/apt/sources.list.d/nodesource.list
26
81
RUN apt-get update && apt-get install -y nodejs
27
82
28
83
RUN mkdir /gp-code \
@@ -41,14 +96,15 @@ RUN apt-get install -y pkg-config dbus xvfb libgtk-3-0 libxkbfile-dev libkrb5-de
41
96
# Start dbus session
42
97
&& mkdir -p /var/run/dbus
43
98
44
- # Disable v8 cache used by yarn v1.x, refs https://github.com/nodejs/node/issues/51555
45
- ENV DISABLE_V8_COMPILE_CACHE=1
46
-
47
- # ENV npm_config_arch=x64
99
+ ENV npm_config_arch=x64
48
100
RUN mkdir -p .build \
49
101
&& npm config set registry "$NPM_REGISTRY" \
50
102
&& npm ci
51
103
104
+ # copy remote dependencies build in dependencies_builder image
105
+ RUN rm -rf remote/node_modules/
106
+ COPY --from=dependencies_builder /gp-code/remote/node_modules/ /gp-code/remote/node_modules/
107
+
52
108
# check that the provided codeVersion is the correct one for the given codeCommit
53
109
RUN commitVersion=$(cat package.json | jq -r .version) \
54
110
&& if [ "$commitVersion" != "$CODE_VERSION" ]; then echo "Code version mismatch: $commitVersion != $CODE_VERSION" ; exit 1; fi
0 commit comments