Skip to content

Commit de8b1ec

Browse files
committed
Try fix nightly dockerfile
1 parent 29ac25b commit de8b1ec

File tree

2 files changed

+25
-19
lines changed

2 files changed

+25
-19
lines changed

components/ide/code/leeway.Dockerfile

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
99
ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1
1010
ENV VSCODE_ARCH=x64
1111
ENV NPM_REGISTRY=https://registry.npmjs.org
12+
ENV NODE_VERSION=20
1213

1314
ARG CODE_COMMIT
1415
ARG CODE_QUALITY
@@ -17,12 +18,7 @@ ARG CODE_VERSION
1718
RUN sudo mkdir -m 0755 -p /etc/apt/keyrings
1819
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
1920

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
21+
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
2622
RUN apt-get update && apt-get install -y nodejs
2723

2824
RUN mkdir /gp-code \
@@ -41,9 +37,6 @@ RUN apt-get install -y pkg-config dbus xvfb libgtk-3-0 libxkbfile-dev libkrb5-de
4137
# Start dbus session
4238
&& mkdir -p /var/run/dbus
4339

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-
4740
# ENV npm_config_arch=x64
4841
RUN mkdir -p .build \
4942
&& npm config set registry "$NPM_REGISTRY" \

components/ide/code/leeway.nightly.Dockerfile

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
# 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: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+
420
FROM gitpod/openvscode-server-linux-build-agent:focal-x64 as code_builder
521

622
ENV TRIGGER_REBUILD 1
@@ -9,6 +25,7 @@ ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
925
ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1
1026
ENV VSCODE_ARCH=x64
1127
ENV NPM_REGISTRY=https://registry.npmjs.org
28+
ENV NODE_VERSION=20
1229

1330
ARG CODE_COMMIT
1431
ARG CODE_QUALITY
@@ -17,12 +34,7 @@ ARG CODE_VERSION
1734
RUN sudo mkdir -m 0755 -p /etc/apt/keyrings
1835
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
1936

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
37+
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
2638
RUN apt-get update && apt-get install -y nodejs
2739

2840
RUN mkdir /gp-code \
@@ -41,14 +53,15 @@ RUN apt-get install -y pkg-config dbus xvfb libgtk-3-0 libxkbfile-dev libkrb5-de
4153
# Start dbus session
4254
&& mkdir -p /var/run/dbus
4355

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
56+
ENV npm_config_arch=x64
4857
RUN mkdir -p .build \
4958
&& npm config set registry "$NPM_REGISTRY" \
5059
&& npm ci
5160

61+
# copy remote dependencies build in dependencies_builder image
62+
RUN rm -rf remote/node_modules/
63+
COPY --from=dependencies_builder /gp-code/remote/node_modules/ /gp-code/remote/node_modules/
64+
5265
# check that the provided codeVersion is the correct one for the given codeCommit
5366
RUN commitVersion=$(cat package.json | jq -r .version) \
5467
&& if [ "$commitVersion" != "$CODE_VERSION" ]; then echo "Code version mismatch: $commitVersion != $CODE_VERSION"; exit 1; fi

0 commit comments

Comments
 (0)