Answers: <p>There is <a href="https://github.com/moby/moby/issues/37531" rel="nofollow noreferrer">Docker's known issue #37531</a></p>
  
  <p>To fix dependencies, you might try:</p>
  
  <ol>
  <li>Either upgrade <code>Docker</code> to 17.02</li>
  </ol>
  
  <pre><code>curl -sSL https://get.docker.com/ | sudo bash
  </code></pre>
  
  <ol start="2">
  <li>or install lib inside of container.
  Since your container based on Centos (<code>FROM centos</code>), so try <code>yum install</code></li>
  </ol>
  
  <pre><code>rpm -ql libXtst-devel-1.2.2-2.1.el6.x86_64
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2020-03-10T16:43:30.277Z
Answers: I have `Docker version 19.03.7`
Answers: Sachith Muhandiram
Answers: CC BY-SA 4.0
Answers: 2020-03-10T16:05:11.540Z
Answers: 2020-03-10T16:05:11.540Z
Answers: Yasen
Body: <p>I am developing an Erlang-OTP application, for that I use a docker image.</p>
  
  <p><code>docker-compose.yml</code>:</p>
  
  <pre><code>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
  </code></pre>
  
  <p>Commands to run <code>docker-compose</code></p>
  
  <pre><code>sudo docker-compose build
  sudo docker-compose run --rm myimage bash
  </code></pre>
  
  <p>When I try to run production tar created by <code>Ubuntu-18.04</code>, I get:</p>
  
  <blockquote>
    <p>error while loading shared libraries: libtinfo.so.6: cannot open shared object file: No such file or directory.</p>
  </blockquote>
  
  <p>I dont get any error while compiling. When I create this tar from <code>Debian-9</code>, it runs without error.</p>
  
  <p>Debian machine has locally installed <code>erlang-otp</code>, but Ubuntu doesnt have.</p>
  
Tags: <docker><docker-compose>
Title: error while loading shared libraries: libtinfo.so.6 : two behaviors for same docker image
UserDisplayName: Sachith Muhandiram
ThreadText: # error while loading shared libraries: libtinfo.so.6 : two behaviors for same docker image
  
  (Asked by: username_0 on 2020-03-09)
  
  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 \
     && yum -y install \
        autoconf \
        gcc \
        gcc-c++ \
        git \
        glibc-devel \
        make \
        ncurses-devel \
        tar \
        curl
  
  ENV SSL_VERSION="1.0.2p"
  
  RUN set -e \
     && mkdir -p /tmp/openssl \
     && cd /tmp \
     && curl -fSL -o openssl.sha256   http://www.openssl.org/source/openssl-${SSL_VERSION}.tar.gz.sha256 \
     && curl -fSL -o openssl.tar.gz http://www.openssl.org/source/openssl-${SSL_VERSION}.tar.gz \
     && SHA=$(printf "%s  openssl.tar.gz" `cat openssl.sha256` | sha256sum -c -); if [ "openssl.tar.gz: OK" != "${SHA}" ]; then exit 3; fi \
     && tar -zxf openssl.tar.gz -C /tmp/openssl --strip-components=1 \
     && cd /tmp/openssl \
     && ./Configure \
           --prefix=/usr/local/ssl \
           --openssldir=/usr/local/ssl \
        linux-x86_64 \
        shared \
     && make -j4 \
     && make install \
     && rm -Rf /tmp/openssl*
  
  ENV OTP_VERSION="20.3.6"
  ENV WITH_NATIVE=true
  
  RUN set -e \
     && mkdir -p /tmp/otp_src \
     && cd /tmp \
     && curl --tlsv1.2 -fSL -o otp_src.tar.gz https://github.com/erlang/otp/archive/OTP-20.3.6.tar.gz \
     && tar -zxf otp_src.tar.gz -C /tmp/otp_src --strip-components=1 \
     && cd /tmp/otp_src \
     && ./otp_build autoconf \
     && ./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" && echo "--enable-hipe --enable-native-libs"` \
     && make -j4 \
     && make install \
     && ln -s /usr/local/otp_${OTP_VERSION} /usr/local/otp \
     && rm -Rf /tmp/otp_src*
  
  ENV PATH $PATH:/usr/local/otp/bin
  
  RUN set -e \
     && yum -y install \
        which
  
  ENV REBAR3_VERSION="3.6.1"
  
  RUN set -xe \
      && REBAR3_DOWNLOAD_URL="https://github.com/erlang/rebar3/archive/${REBAR3_VERSION}.tar.gz" \
      && REBAR3_DOWNLOAD_SHA256="40b3c85440f3235c7b149578d0211bdf57d1c66390f888bb771704f8abc71033" \
      && mkdir -p /usr/src/rebar3-src \
      && curl --tlsv1.2 -fSL -o rebar3-src.tar.gz "$REBAR3_DOWNLOAD_URL" \
      && echo "$REBAR3_DOWNLOAD_SHA256 rebar3-src.tar.gz" | sha256sum -c - \
      && tar -xzf rebar3-src.tar.gz -C /usr/src/rebar3-src --strip-components=1 \
      && rm rebar3-src.tar.gz \
      && cd /usr/src/rebar3-src \
      && HOME=$PWD ./bootstrap \
      && install -v ./rebar3 /usr/local/bin/ \
      && 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.
  
  **Tags:** docker, docker-compose
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-03-10. Score: 1
  
  There is [Docker's known issue #37531](https://github.com/moby/moby/issues/37531)
  
  To fix dependencies, you might try:
  
  1. Either upgrade `Docker` to 17.02
  
  ```
  curl -sSL https://get.docker.com/ | sudo bash
  
  ```
  
  2. 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
  
  ```
  
  > **Comments:**
  > **username_0**: I have `Docker version 19.03.7`  
  
  ---
  
  