Skip to content

Commit a456cf4

Browse files
do not build musl assembly
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
1 parent 102536e commit a456cf4

1 file changed

Lines changed: 71 additions & 66 deletions

File tree

build/dockerfiles/linux-musl.Dockerfile

Lines changed: 71 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -6,75 +6,80 @@
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-
# compile some javascript native stuff (node-gyp)
16-
make gcc g++ python3 py3-pip \
17-
# git
18-
git \
19-
# bash shell
20-
bash \
21-
# some lib to compile 'native-keymap' npm mpdule
22-
libx11-dev libxkbfile-dev \
23-
# requirements for keytar
24-
libsecret libsecret-dev \
25-
# kerberos authentication
26-
krb5-dev
27-
28-
#########################################################
9+
# FROM docker.io/node:22-alpine3.22 as linux-musl-builder
2910
#
30-
# 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
3126
#
32-
#########################################################
33-
COPY code /checode-compilation
34-
WORKDIR /checode-compilation
35-
ENV ELECTRON_SKIP_BINARY_DOWNLOAD=1
36-
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
37-
38-
# workaround for https://github.com/nodejs/node/issues/52229
39-
ENV CXXFLAGS='-DNODE_API_EXPERIMENTAL_NOGC_ENV_OPT_OUT'
40-
41-
# Initialize a git repository for code build tools
42-
RUN git init .
43-
44-
# change network timeout (slow using multi-arch build)
45-
RUN npm config set fetch-retry-mintimeout 100000 && npm config set fetch-retry-maxtimeout 600000
46-
47-
# Grab dependencies (and force to rebuild them)
48-
RUN rm -rf /checode-compilation/node_modules && npm install --force
49-
50-
# Rebuild platform specific dependencies
51-
RUN npm rebuild
52-
53-
RUN NODE_VERSION=$(cat /checode-compilation/remote/.npmrc | grep target | cut -d '=' -f 2 | tr -d '"') \
54-
# cache node from this image to avoid to grab it from within the build
55-
&& echo "caching /checode-compilation/.build/node/v${NODE_VERSION}/linux-alpine/node" \
56-
&& mkdir -p /checode-compilation/.build/node/v${NODE_VERSION}/linux-alpine \
57-
&& cp /usr/local/bin/node /checode-compilation/.build/node/v${NODE_VERSION}/linux-alpine/node \
58-
# workaround to fix build
59-
&& cp -r /checode-compilation/node_modules/tslib /checode-compilation/remote/node_modules/
60-
61-
RUN VSCODE_MANGLE_WORKERS=2 NODE_OPTIONS="--max-old-space-size=8192" ./node_modules/.bin/gulp vscode-reh-web-linux-alpine-min
62-
RUN cp -r ../vscode-reh-web-linux-alpine /checode
63-
64-
RUN chmod a+x /checode/out/server-main.js \
65-
&& chgrp -R 0 /checode && chmod -R g+rwX /checode
66-
67-
#########################################################
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
6848
#
69-
# Copy VS Code launcher to the container
49+
# # Rebuild platform specific dependencies
50+
# RUN npm rebuild
7051
#
71-
#########################################################
72-
COPY launcher /checode-launcher
73-
WORKDIR /checode-launcher
74-
RUN npm install \
75-
&& mkdir /checode/launcher \
76-
&& cp -r out/src/*.js /checode/launcher \
77-
&& 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
7883

7984
FROM scratch as linux-musl-content
80-
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)