Adjusting LD_LIBRARY_PATH in containers
I'm building a container from store/intersystems/iris-community:2019.4.0.383.0 .
I need to add my folder to the LD_LIBRARY_PATH so that my custom shared library would load at runtime.
How can I do that?
Here's what I tried:
ARG IMAGE=store/intersystems/iris-community:2019.4.0.383.0
FROM ${IMAGE}
USER root
ENV MYDIR /usr/mydir
ENV LD_LIBRARY_PATH $MYDIR:$LD_LIBRARY_PATH
RUN mkdir "$MYDIR"; \
chown -hR $ISC_PACKAGE_IRISUSER:$ISC_PACKAGE_IRISGROUP $MYDIR; \
chmod -R 777 $MYDIR; \
echo "LD_LIBRARY_PATH=\"$MYDIR\"" >> /etc/environment; \
echo "$MYDIR" >> /etc/ld.so.conf.d/my.conf; \
echo "LD_LIBRARY_PATH=$MYDIR:$LD_LIBRARY_PATH" >> /home/$ISC_PACKAGE_IRISUSER/.profile; \
echo "LD_LIBRARY_PATH=$MYDIR:$LD_LIBRARY_PATH" >> /home/$ISC_PACKAGE_MGRUSER/.profile; \
ldconfig; \
echo $LD_LIBRARY_PATH;
USER irisowner
RUN iris start $ISC_PACKAGE_INSTANCENAME && \
/bin/echo -e "w \$system.Util.GetEnviron(\"LD_LIBRARY_PATH\")" \
" halt" \
| iris session $ISC_PACKAGE_INSTANCENAME && \
iris stop $ISC_PACKAGE_INSTANCENAME quietly
However at both buildtime and runtime this call:
w $system.Util.GetEnviron("LD_LIBRARY_PATH")
returns
/usr/irissys/bin
And not
/usr/mydir:/usr/irissys/bin
Which at runtime causes my main issue:
Failed to load dynamic library <> cannot open shared object file: No such file or directory
Any ideas?