error while loading shared libraries: libtinfo.so.6 : two behaviors for same docker image I am developing an Erlang-OTP application, for that I use a docker image.

docker-compose.yml:

FROM centos
LABEL Name=myimage Version=2.0.0

RUN set -e \
   &amp;&amp; yum -y install \
      autoconf \
      gcc \
      gcc-c++ \
      git \
      glibc-devel \
      make \
      ncurses-devel \
      tar \
      curl


ENV SSL_VERSION="1.0.2p"

RUN set -e \
   &amp;&amp; mkdir -p /tmp/openssl \
   &amp;&amp; cd /tmp \
   &amp;&amp; curl -fSL -o openssl.sha256   http://www.openssl.org/source/openssl-${SSL_VERSION}.tar.gz.sha256 \
   &amp;&amp; curl -fSL -o openssl.tar.gz http://www.openssl.org/source/openssl-${SSL_VERSION}.tar.gz \
   &amp;&amp; SHA=$(printf "%s  openssl.tar.gz" `cat openssl.sha256` | sha256sum -c -); if [ "openssl.tar.gz: OK" != "${SHA}" ]; then exit 3; fi \
   &amp;&amp; tar -zxf openssl.tar.gz -C /tmp/openssl --strip-components=1 \
   &amp;&amp; cd /tmp/openssl \
   &amp;&amp; ./Configure \
         --prefix=/usr/local/ssl \
         --openssldir=/usr/local/ssl \
      linux-x86_64 \
      shared \
   &amp;&amp; make -j4 \
   &amp;&amp; make install \
   &amp;&amp; rm -Rf /tmp/openssl*

ENV OTP_VERSION="20.3.6"
ENV WITH_NATIVE=true

RUN set -e \
   &amp;&amp; mkdir -p /tmp/otp_src \
   &amp;&amp; cd /tmp \
   &amp;&amp; curl --tlsv1.2 -fSL -o otp_src.tar.gz https://github.com/erlang/otp/archive/OTP-20.3.6.tar.gz \
   &amp;&amp; tar -zxf otp_src.tar.gz -C /tmp/otp_src --strip-components=1 \
   &amp;&amp; cd /tmp/otp_src \
   &amp;&amp; ./otp_build autoconf \
   &amp;&amp; ./configure \
         --prefix=/usr/local/otp \
         --enable-threads \
         --enable-smp-support \
         --enable-kernel-poll \
         --disable-dynamic-ssl-lib \
         --with-ssl=/usr/local/ssl \
         `test "${WITH_NATIVE}" = "true" &amp;&amp; echo "--enable-hipe --enable-native-libs"` \
   &amp;&amp; make -j4 \
   &amp;&amp; make install \
   &amp;&amp; ln -s /usr/local/otp_${OTP_VERSION} /usr/local/otp \
   &amp;&amp; rm -Rf /tmp/otp_src*

ENV PATH $PATH:/usr/local/otp/bin

RUN set -e \
   &amp;&amp; yum -y install \
      which


ENV REBAR3_VERSION="3.6.1"

RUN set -xe \
    &amp;&amp; REBAR3_DOWNLOAD_URL="https://github.com/erlang/rebar3/archive/${REBAR3_VERSION}.tar.gz" \
    &amp;&amp; REBAR3_DOWNLOAD_SHA256="40b3c85440f3235c7b149578d0211bdf57d1c66390f888bb771704f8abc71033" \
    &amp;&amp; mkdir -p /usr/src/rebar3-src \
    &amp;&amp; curl --tlsv1.2 -fSL -o rebar3-src.tar.gz "$REBAR3_DOWNLOAD_URL" \
    &amp;&amp; echo "$REBAR3_DOWNLOAD_SHA256 rebar3-src.tar.gz" | sha256sum -c - \
    &amp;&amp; tar -xzf rebar3-src.tar.gz -C /usr/src/rebar3-src --strip-components=1 \
    &amp;&amp; rm rebar3-src.tar.gz \
    &amp;&amp; cd /usr/src/rebar3-src \
    &amp;&amp; HOME=$PWD ./bootstrap \
    &amp;&amp; install -v ./rebar3 /usr/local/bin/ \
    &amp;&amp; rm -rf /usr/src/rebar3-src

RUN mkdir /myimage
WORKDIR /myimage


Commands to run docker-compose

sudo docker-compose build
sudo docker-compose run --rm myimage bash


When I try to run production tar created by Ubuntu-18.04, I get:


  error while loading shared libraries: libtinfo.so.6: cannot open shared object file: No such file or directory.


I dont get any error while compiling. When I create this tar from Debian-9, it runs without error.

Debian machine has locally installed erlang-otp, but Ubuntu doesnt have.
There is Docker's known issue #37531

To fix dependencies, you might try:


Either upgrade Docker to 17.02


curl -sSL https://get.docker.com/ | sudo bash



or install lib inside of container.
Since your container based on Centos (FROM centos), so try yum install


rpm -ql libXtst-devel-1.2.2-2.1.el6.x86_64