Skip to content

Commit e950578

Browse files
fixm
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
1 parent 4e97490 commit e950578

2 files changed

Lines changed: 19 additions & 7 deletions

File tree

build/dockerfiles/linux-libc-ubi9.Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ RUN NODE_ARCH=$(echo "console.log(process.arch)" | node) \
8585
&& find /usr/lib64 -name 'libnode.so*' -exec cp -P -t /checode/ld_libs/ {} + \
8686
&& find /usr/lib64 -name 'libz.so*' -exec cp -P -t /checode/ld_libs/ {} + \
8787
&& find /usr/lib64 -name 'libssl.so*' -exec cp -P -t /checode/ld_libs/ {} + \
88-
&& find /usr/lib64 -name 'libcrypto.so*' -exec cp -P -t /checode/ld_libs/ {} +
88+
&& find /usr/lib64 -name 'libcrypto.so*' -exec cp -P -t /checode/ld_libs/ {} + \
89+
&& find /usr/lib64 -name 'libstdc++.so*' -exec cp -P -t /checode/ld_libs/ {} + \
90+
&& find /usr/lib64 -name 'libgcc_s.so*' -exec cp -P -t /checode/ld_libs/ {} +
8991

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

build/scripts/entrypoint-volume.sh

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ get_openssl_version() {
5050
openssl_version=$(openssl version -v | cut -d' ' -f2 | cut -d'.' -f1)
5151
elif command -v rpm >/dev/null 2>&1; then
5252
echo "[INFO] rpm command is available"
53-
openssl_version=$(rpm -qa | grep openssl-libs | cut -d'-' -f3 | cut -d'.' -f1)
53+
for pkg in $(rpm -qa 2>/dev/null); do
54+
case "$pkg" in
55+
openssl-libs-*)
56+
openssl_version=$(echo "$pkg" | cut -d'-' -f3 | cut -d'.' -f1)
57+
break
58+
;;
59+
esac
60+
done
5461
else
5562
echo "[INFO] openssl and rpm commands are not available, trying to detect OpenSSL version..."
5663
get_libssl_version
@@ -75,12 +82,14 @@ nohup /checode/bin/machine-exec --url "127.0.0.1:${MACHINE_EXEC_PORT}" &
7582

7683
# Start the checode component based on musl or libc
7784

78-
# detect if we're using alpine/musl
79-
libc=$(ldd /bin/ls | grep 'musl' | head -1 | cut -d ' ' -f1)
80-
if [ -n "$libc" ]; then
85+
# detect if we're using alpine/musl (avoid grep dependency for micro images)
86+
ldd_output=$(ldd /bin/ls 2>/dev/null || true)
87+
case "$ldd_output" in
88+
*musl*)
8189
echo "[INFO] Using linux-musl assembly..."
8290
cd /checode/checode-linux-musl || exit
83-
else
91+
;;
92+
*)
8493

8594
get_openssl_version
8695
echo "[INFO] OpenSSL major version is: $openssl_version."
@@ -109,7 +118,8 @@ else
109118
cd /checode/checode-linux-libc/ubi9 || exit
110119
;;
111120
esac
112-
fi
121+
;;
122+
esac
113123

114124
# Set the default path to the serverDataFolderName
115125
# into a persistent volume

0 commit comments

Comments
 (0)