Skip to content

Commit 1468a21

Browse files
fix: Fix starting a workspace when target container does not contain libs Node.js depends on
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
1 parent c57f8d2 commit 1468a21

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

build/dockerfiles/linux-libc-ubi8.Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ RUN NODE_ARCH=$(echo "console.log(process.arch)" | node) \
7979
&& echo "caching /checode-compilation/.build/node/v${NODE_VERSION}/linux-${NODE_ARCH}/node" \
8080
&& cp /usr/bin/node /checode-compilation/.build/node/v${NODE_VERSION}/linux-${NODE_ARCH}/node \
8181
&& NODE_OPTIONS="--max-old-space-size=4096" ./node_modules/.bin/gulp vscode-reh-web-linux-${NODE_ARCH}-min \
82-
&& cp -r ../vscode-reh-web-linux-${NODE_ARCH} /checode
82+
&& cp -r ../vscode-reh-web-linux-${NODE_ARCH} /checode \
83+
# cache shared libs from this image to provide them to a user's container
84+
&& mkdir -p /checode/ld_libs \
85+
&& find /usr/lib64 -name 'libnode.so*' -exec cp -P -t /checode/ld_libs/ {} + \
86+
&& find /usr/lib64 -name 'libz.so*' -exec cp -P -t /checode/ld_libs/ {} +
8387

8488
RUN chmod a+x /checode/out/server-main.js \
8589
&& chgrp -R 0 /checode && chmod -R g+rwX /checode

build/dockerfiles/linux-libc-ubi9.Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,11 @@ RUN NODE_ARCH=$(echo "console.log(process.arch)" | node) \
7979
&& cp /usr/bin/node /checode-compilation/.build/node/v${NODE_VERSION}/linux-${NODE_ARCH}/node \
8080
&& NODE_OPTIONS="--max-old-space-size=4096" ./node_modules/.bin/gulp vscode-reh-web-linux-${NODE_ARCH}-min \
8181
&& cp -r ../vscode-reh-web-linux-${NODE_ARCH} /checode \
82-
# cache libbrotli from this image to provide it to a user's container
83-
&& mkdir -p /checode/ld_libs && find /usr/lib64 -name 'libbrotli*' 2>/dev/null | xargs -I {} cp -t /checode/ld_libs {}
82+
# cache shared libs from this image to provide them to a user's container
83+
&& mkdir -p /checode/ld_libs \
84+
&& find /usr/lib64 -name 'libbrotli*' 2>/dev/null | xargs -I {} cp -t /checode/ld_libs {} \
85+
&& find /usr/lib64 -name 'libnode.so*' -exec cp -P -t /checode/ld_libs/ {} + \
86+
&& find /usr/lib64 -name 'libz.so*' -exec cp -P -t /checode/ld_libs/ {} +
8487

8588
RUN chmod a+x /checode/out/server-main.js \
8689
&& chgrp -R 0 /checode && chmod -R g+rwX /checode

build/scripts/entrypoint-volume.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ else
8787

8888
case "${openssl_version}" in
8989
*"1"*)
90+
export LD_LIBRARY_PATH="/checode/checode-linux-libc/ubi8/ld_libs:$LD_LIBRARY_PATH"
91+
echo "[INFO] LD_LIBRARY_PATH is: $LD_LIBRARY_PATH"
92+
9093
echo "[INFO] Using linux-libc ubi8-based assembly..."
9194
cd /checode/checode-linux-libc/ubi8 || exit
9295
;;

0 commit comments

Comments
 (0)