File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
9092RUN chmod a+x /checode/out/server-main.js \
9193 && chgrp -R 0 /checode && chmod -R g+rwX /checode
Original file line number Diff line number Diff 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 ."
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
You can’t perform that action at this time.
0 commit comments