Skip to content

Commit edc7808

Browse files
committed
[code] fix #3832: support previous and current ubuntu LTS
1 parent ec9a192 commit edc7808

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

components/ide/code/leeway.Dockerfile

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44

55
# we use latest major version of Node.js distributed VS Code. (see about dialog in your local VS Code)
66
# ideallay we should use exact version, but it has criticla bugs in regards to grpc over http2 streams
7-
FROM node:12.21.0 AS node_installer
7+
ARG NODE_VERSION=12.21.0
8+
9+
10+
FROM node:${NODE_VERSION} AS node_installer
811
RUN mkdir -p /ide/node/bin \
912
/ide/node/include/node/ \
1013
/ide/node/lib/node_modules/npm/ \
@@ -19,17 +22,26 @@ RUN mkdir -p /ide/node/bin \
1922
RUN cp /ide/node/bin/node /ide/node/bin/gitpod-node && rm /ide/node/bin/node
2023

2124

22-
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-12 as code_installer
23-
25+
FROM ubuntu:18.04 as code_installer
2426

25-
# see https://github.com/gitpod-io/vscode/blob/bdeca3f8709b70b339f41fc2a14e94f83d6475ac/.github/workflows/ci.yml#L130
26-
RUN sudo apt-get update \
27-
&& sudo apt-get -y install --no-install-recommends libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libgbm1 \
27+
RUN apt-get update \
28+
# see https://github.com/microsoft/vscode/blob/42e271dd2e7c8f320f991034b62d4c703afb3e28/.github/workflows/ci.yml#L94
29+
&& apt-get -y install --no-install-recommends libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libgbm1 \
30+
&& apt-get -y install --no-install-recommends git curl build-essential libssl-dev ca-certificates python \
2831
# Clean up
29-
&& sudo apt-get autoremove -y \
30-
&& sudo apt-get clean -y \
32+
&& apt-get autoremove -y \
33+
&& apt-get clean -y \
3134
&& rm -rf /var/lib/apt/lists/*
3235

36+
ARG NODE_VERSION
37+
ENV NVM_DIR /root/.nvm
38+
RUN curl -fsSL https://github.com/raw/nvm-sh/nvm/v0.38.0/install.sh | sh \
39+
&& . $NVM_DIR/nvm.sh \
40+
&& nvm install $NODE_VERSION \
41+
&& nvm alias default $NODE_VERSION \
42+
&& npm install -g yarn node-gyp
43+
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
44+
3345
ENV GP_CODE_COMMIT cbe1690286445dde2260d88e6de5bce1413465c6
3446
RUN mkdir gp-code \
3547
&& cd gp-code \
@@ -48,6 +60,7 @@ RUN chmod -R ugo+w /gitpod-pkg-server/extensions
4860
COPY bin /ide/bin
4961
RUN chmod -R ugo+x /ide/bin
5062

63+
5164
FROM scratch
5265
# copy static web resources in first layer to serve from blobserve
5366
COPY --from=code_installer /gitpod-pkg-web/ /ide/

0 commit comments

Comments
 (0)