<p>I am creating a custom Builder Image using S2i dotnet core. This will run in OpenShift linux container</p>
<p>I have modified the custom builder image and included few lines to copy few dlls and &quot;.so&quot; files</p>
<p>When running the container in OpenShift I am facing the below error</p>
<p>error says</p>
<pre><code>&quot;unable to load shared library 'CustomCppWrapper' or one of its dependencies. In order to help diagnose loading problems, 
consider setting the LD_DEBUG environment variable: libWrapperName: cannot open shared object file: No such file or directory&quot;
</code></pre>
<p>I have set the LD_DEBUG environment variable and found below few errors</p>
<pre><code>/lib64/libstdc++.so.6: error: version lookup error: version `CXXABI_1.3.8' not found (required by /opt/app-root/app/libCWrappeNamer.so) (fatal)
/lib64/libstdc++.so.6: error: version lookup error: version `CXXABI_1.3.8' not found (required by ./libCWrappeNamer.so) (fatal)
</code></pre>
<p>I did below command and found below</p>
<p><code>ldd libCWrappeNamer.so</code></p>
<pre><code>./libCWrappeNamer.so: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by ./libCWrappeNamer.so)
./libCWrappeNamer.so: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /ab/sdk/customlib/gcc540/lib/libabc.so)
./libCWrappeNamer.so: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /ab/sdk/customlib/gcc540/lib/libxmlc.so)
</code></pre>
<p>Below is my Custom Docker file builder image</p>
<pre><code>FROM dotnet/dotnet-31-runtime-rhel7
# This image provides a .NET Core 3.1 environment you can use to run your .NET
# applications.

ENV PATH=/opt/app-root/src/.local/bin:/opt/app-root/src/bin:/opt/app-root/node_modules/.bin:${PATH} \
    STI_SCRIPTS_PATH=/usr/libexec/s2i

LABEL io.k8s.description=&quot;Platform for building and running .NET Core 3.1 applications&quot; \
      io.openshift.tags=&quot;builder,.net,dotnet,dotnetcore,rh-dotnet31&quot;

# Labels consumed by Red Hat build service
LABEL name=&quot;dotnet/dotnet-31-rhel7&quot; \
      com.redhat.component=&quot;rh-dotnet31-container&quot; \
      version=&quot;3.1&quot; \
      release=&quot;1&quot; \
      architecture=&quot;x86_64&quot;

#-------------------------- COPY CPP LIBS

COPY CustomCppWrapper.lib /opt/app-root/app
COPY libCWrappeNamer.so /opt/app-root/app


#----------------------------------


# Labels consumed by Eclipse JBoss OpenShift plugin
LABEL com.redhat.dev-mode=&quot;DEV_MODE:false&quot; \
      com.redhat.deployments-dir=&quot;/opt/app-root/src&quot;

# Switch to root for package installs
USER 0

# Copy the S2I scripts from the specific language image to $STI_SCRIPTS_PATH.
COPY ./s2i/bin/ /usr/libexec/s2i

RUN INSTALL_PKGS=&quot;rh-nodejs10-npm rh-nodejs10-nodejs-nodemon rh-dotnet31-dotnet-sdk-3.1 rsync&quot; &amp;&amp; \
    yum install -y --setopt=tsflags=nodocs --disablerepo=\* \
      --enablerepo=rhel-7-server-rpms,rhel-server-rhscl-7-rpms,rhel-7-server-dotnet-rpms \
      $INSTALL_PKGS &amp;&amp; \
    rpm -V $INSTALL_PKGS &amp;&amp; \
    yum clean all -y &amp;&amp; \
# yum cache files may still exist (and quite large in size)
    rm -rf /var/cache/yum/*

# Directory with the sources is set as the working directory.
RUN mkdir /opt/app-root/src
WORKDIR /opt/app-root/src

# Trigger first time actions.
RUN scl enable rh-dotnet31 'dotnet help'

# Build the container tool.
RUN /usr/libexec/s2i/container-tool build-tool

# Since $HOME is set to /opt/app-root, the yum install may have created config
# directories (such as ~/.pki/nssdb) there. These will be owned by root and can
# cause actions that work on all of /opt/app-root to fail. So we need to fix
# the permissions on those too.
RUN chown -R 1001:0 /opt/app-root &amp;&amp; fix-permissions /opt/app-root

ENV ENABLED_COLLECTIONS=&quot;$ENABLED_COLLECTIONS rh-nodejs10&quot; \
# Needed for the `dotnet watch` to detect changes in a container.
    DOTNET_USE_POLLING_FILE_WATCHER=true

# Run container by default as user with id 1001 (default)
USER 1001

# Set the default CMD to print the usage of the language image.
CMD /usr/libexec/s2i/usage
</code></pre>

<p>Your code depends on libstdc++.so.6 but it would seem that version isn't installed</p>
<p>In your Dockerfile, add the <code>yum install</code> command that should do it. It would depend on what operating system you're using, but for RHEL 7, for example, you could do:</p>
<p><code>RUN yum install -y libstdc++</code></p>
<p>With more details of the operating system I can give a more specific command</p>
<p>In this specific examples the Dockerfile could look something like this:</p>
<pre><code>FROM centos:7

RUN yum install -y libstdc++

CMD [&quot;/bin/bash&quot;]

</code></pre>
