Skip to content

Commit 7457ce1

Browse files
Merge remote-tracking branch 'fork/main' into test
2 parents 25c28df + a456cf4 commit 7457ce1

1 file changed

Lines changed: 72 additions & 68 deletions

File tree

Lines changed: 72 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,85 @@
1-
# Copyright (c) 2021-2026 Red Hat, Inc.
1+
# Copyright (c) 2021-2023 Red Hat, Inc.
22
# This program and the accompanying materials are made
33
# available under the terms of the Eclipse Public License 2.0
44
# which is available at https://www.eclipse.org/legal/epl-2.0/
55
#
66
# SPDX-License-Identifier: EPL-2.0
77
#
88

9-
# Make an assembly including both musl and libc variant to be able to run on all linux systems
10-
FROM docker.io/node:22-alpine3.22 as linux-musl-builder
11-
12-
RUN apk add --update --no-cache \
13-
# Download some files
14-
curl \
15-
patch \
16-
# compile some javascript native stuff (node-gyp)
17-
make gcc g++ python3 py3-pip \
18-
# git
19-
git \
20-
# bash shell
21-
bash \
22-
# some lib to compile 'native-keymap' npm mpdule
23-
libx11-dev libxkbfile-dev \
24-
# requirements for keytar
25-
libsecret libsecret-dev \
26-
# kerberos authentication
27-
krb5-dev
28-
29-
#########################################################
9+
# FROM docker.io/node:22-alpine3.22 as linux-musl-builder
3010
#
31-
# Copy Che-Code to the container
11+
# RUN apk add --update --no-cache \
12+
# # Download some files
13+
# curl \
14+
# # compile some javascript native stuff (node-gyp)
15+
# make gcc g++ python3 py3-pip \
16+
# # git
17+
# git \
18+
# # bash shell
19+
# bash \
20+
# # some lib to compile 'native-keymap' npm module
21+
# libx11-dev libxkbfile-dev \
22+
# # requirements for keytar
23+
# libsecret libsecret-dev \
24+
# # kerberos authentication
25+
# krb5-dev
3226
#
33-
#########################################################
34-
COPY code /checode-compilation
35-
WORKDIR /checode-compilation
36-
ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1
37-
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
38-
39-
# workaround for https://github.com/nodejs/node/issues/52229
40-
ENV CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT'
41-
42-
# Initialize a git repository for code build tools
43-
RUN git init .
44-
45-
# change network timeout (slow using multi-arch build)
46-
RUN npm config set fetch-retry-mintimeout 100000 && npm config set fetch-retry-maxtimeout 600000
47-
48-
# Grab dependencies (and force to rebuild them)
49-
RUN rm -rf /checode-compilation/node_modules && npm install --force
50-
51-
# Rebuild platform specific dependencies
52-
RUN npm rebuild
53-
54-
RUN NODE_VERSION=$(cat /checode-compilation/remote/.npmrc | grep target | cut -d '=' -f 2 | tr -d '"') \
55-
# cache node from this image to avoid to grab it from within the build
56-
&& echo "caching /checode-compilation/.build/node/v${NODE_VERSION}/linux-alpine/node" \
57-
&& mkdir -p /checode-compilation/.build/node/v${NODE_VERSION}/linux-alpine \
58-
&& cp /usr/local/bin/node /checode-compilation/.build/node/v${NODE_VERSION}/linux-alpine/node \
59-
# workaround to fix build
60-
&& cp -r /checode-compilation/node_modules/tslib /checode-compilation/remote/node_modules/
61-
62-
RUN VSCODE_MANGLE_WORKERS=2 NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp vscode-reh-web-linux-alpine-min
63-
RUN cp -r ../vscode-reh-web-linux-alpine /checode
64-
65-
RUN chmod a+x /checode/out/server-main.js \
66-
&& chgrp -R 0 /checode && chmod -R g+rwX /checode
67-
68-
#########################################################
27+
# #########################################################
28+
# #
29+
# # Copy Che-Code to the container
30+
# #
31+
# #########################################################
32+
# COPY code /checode-compilation
33+
# WORKDIR /checode-compilation
34+
# ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1
35+
# ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
36+
#
37+
# # workaround for https://github.com/nodejs/node/issues/52229
38+
# ENV CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT'
39+
#
40+
# # Initialize a git repository for code build tools
41+
# RUN git init .
42+
#
43+
# # change network timeout (slow using multi-arch build)
44+
# RUN npm config set fetch-retry-mintimeout 100000 && npm config set fetch-retry-maxtimeout 600000
45+
#
46+
# # Grab dependencies (and force to rebuild them)
47+
# RUN rm -rf /checode-compilation/node_modules && npm install --force
6948
#
70-
# Copy VS Code launcher to the container
49+
# # Rebuild platform specific dependencies
50+
# RUN npm rebuild
7151
#
72-
#########################################################
73-
COPY launcher /checode-launcher
74-
WORKDIR /checode-launcher
75-
RUN npm install \
76-
&& mkdir /checode/launcher \
77-
&& cp -r out/src/*.js /checode/launcher \
78-
&& chgrp -R 0 /checode && chmod -R g+rwX /checode
52+
# RUN NODE_VERSION=$(cat /checode-compilation/remote/.npmrc | grep target | cut -d '=' -f 2 | tr -d '\"') \
53+
# # cache node from this image to avoid to grab it from within the build
54+
# && echo "caching /checode-compilation/.build/node/v${NODE_VERSION}/linux-alpine/node" \
55+
# && mkdir -p /checode-compilation/.build/node/v${NODE_VERSION}/linux-alpine \
56+
# && cp /usr/local/bin/node /checode-compilation/.build/node/v${NODE_VERSION}/linux-alpine/node \
57+
# # workaround to fix build
58+
# && cp -r /checode-compilation/node_modules/tslib /checode-compilation/remote/node_modules/
59+
#
60+
# RUN VSCODE_MANGLE_WORKERS=2 NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp vscode-reh-web-linux-alpine-min
61+
# RUN cp -r ../vscode-reh-web-linux-alpine /checode
62+
#
63+
# RUN chmod a+x /checode/out/server-main.js \
64+
# && chgrp -R 0 /checode && chmod -R g+rwX /checode
65+
#
66+
# #########################################################
67+
# #
68+
# # Copy VS Code launcher to the container
69+
# #
70+
# #########################################################
71+
# COPY launcher /checode-launcher
72+
# WORKDIR /checode-launcher
73+
# RUN npm install \
74+
# && mkdir /checode/launcher \
75+
# && cp -r out/src/*.js /checode/launcher \
76+
# && chgrp -R 0 /checode && chmod -R g+rwX /checode
77+
#
78+
# FROM scratch as linux-musl-content
79+
# COPY --from=linux-musl-builder /checode /checode-linux-musl
80+
81+
FROM docker.io/alpine:3.22 as linux-musl-placeholder
82+
RUN mkdir -p /checode-linux-musl
7983

8084
FROM scratch as linux-musl-content
81-
COPY --from=linux-musl-builder /checode /checode-linux-musl
85+
COPY --from=linux-musl-placeholder /checode-linux-musl /checode-linux-musl

0 commit comments

Comments
 (0)