Skip to content

Commit d721abf

Browse files
mustard-mhjeanp413
andauthored
[vscode] Fix code dockerfile (#20286)
* Fix code nightly dockerfile * Try fix nightly dockerfile * Fix * Fix * Fix * Fix * Update code commit with node 18 patch --------- Co-authored-by: Jean Pierre Huaroto <[email protected]>
1 parent 19d8a73 commit d721abf

File tree

2 files changed

+69
-13
lines changed

2 files changed

+69
-13
lines changed

WORKSPACE.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defaultArgs:
77
publishToNPM: true
88
publishToJBMarketplace: true
99
localAppVersion: unknown
10-
codeCommit: cac02285a3fef09965c46fb813c953b4fd0e13eb
10+
codeCommit: 2ce4401e10ffb3926c3f28c360f66cf9dc38b9cf
1111
codeVersion: 1.94.1
1212
codeQuality: stable
1313
codeWebExtensionCommit: 7ff72a2938a7a06cbdf3964590f7e9b7525958f3

components/ide/code/leeway.Dockerfile

Lines changed: 68 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,83 @@
1-
# Copyright (c) 2020 Gitpod GmbH. All rights reserved.
1+
# Copyright (c) 2024 Gitpod GmbH. All rights reserved.
22
# Licensed under the GNU Affero General Public License (AGPL).
33
# 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
523

624
ENV TRIGGER_REBUILD 1
725

826
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
927
ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1
1028
ENV VSCODE_ARCH=x64
1129
ENV NPM_REGISTRY=https://registry.npmjs.org
30+
ENV NODE_VERSION=20
1231

1332
ARG CODE_COMMIT
1433
ARG CODE_QUALITY
1534
ARG CODE_VERSION
1635

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+
1777
RUN sudo mkdir -m 0755 -p /etc/apt/keyrings
1878
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
1979

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
2681
RUN apt-get update && apt-get install -y nodejs
2782

2883
RUN mkdir /gp-code \
@@ -41,14 +96,15 @@ RUN apt-get install -y pkg-config dbus xvfb libgtk-3-0 libxkbfile-dev libkrb5-de
4196
# Start dbus session
4297
&& mkdir -p /var/run/dbus
4398

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
48100
RUN mkdir -p .build \
49101
&& npm config set registry "$NPM_REGISTRY" \
50102
&& npm ci
51103

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+
52108
# check that the provided codeVersion is the correct one for the given codeCommit
53109
RUN commitVersion=$(cat package.json | jq -r .version) \
54110
&& if [ "$commitVersion" != "$CODE_VERSION" ]; then echo "Code version mismatch: $commitVersion != $CODE_VERSION"; exit 1; fi

0 commit comments

Comments
 (0)