Error running file in Container “error when loading shared libraries” DOCKER

So I am building an image from a dockerfile, using the COPY command to copy a local file from host into my container. After the image is build I run an interactive shell, and test my file which I copied and am having an error.

Here is my shell information.

  • How to use Let's Encrypt with Docker container based on the Node.js image
  • docker-compose: using multiple Dockerfiles for multiple services
  • Accessing Docker for Mac via Remote Access API
  • Docker container logs taking all my disk space
  • Python logic error in 'if' evaluation [closed]
  • Docker: error creating aufs mount to /var/lib/docker/aufs/mnt/15396ee0f38d161382f104e11c94b6ca0efafe10f9952e1dfba4f548009fbe59-init: invalid argument
  • arcolombo@arcolombo:~/Documents/bedgraph_dockerfile$ sudo docker info
    Containers: 18
    Images: 72
    Storage Driver: aufs
     Root Dir: /var/lib/docker/aufs
     Dirs: 108
    Execution Driver: native-0.2
    Kernel Version: 3.16.0-33-generic
    Username: arcolombo
    Registry: []
    WARNING: No swap limit support

    Here is my docker file

    FROM ubuntu
    COPY software /bin

    Note that under my directory where my Dockerfile is contained, I placed my “software” directory, which has a bedWiggle executable in the Dockerfile’s context, so it does get loaded into my new container of which my image creates.

    This shows the successful completion of the image

    arcolombo@arcolombo:~/Documents/bed_dockerfile$ sudo docker build        -t="arcolombo" .
    Sending build context to Docker daemon   2.7 MB
    Sending build context to Docker daemon 
    Step 0 : FROM ubuntu
    ---> d0955f21bf24
    Step 1 : MAINTAINER
      ---> Using cache
      ---> 5el36a81f34
         Step 2 : COPY software /bin
     ---> Using cache
     ---> 1llhh2e278683ea
    Successfully built 1hhfjjeea

    Yet I get the error when I enter the container built by the above image and running my executable

    root@hhhlf75hhhhfcb87ccfa:/bin# ./bedWigggle
    ./bedWiggle: error while loading shared libraries: cannot open shared object file: No such file or directory

  • Firefox Proxy to Docker Fiddler refusing connection
  • Wrong time in Docker container of Django app built by Jenkins
  • How can I open up webcam and process images with docker and OpenCV?
  • Docker (compose) fails to build container when mounting single file from official Wordpress image
  • How can I run Win32OLE calls from ubuntu?
  • NodeJS microservices
  • One Solution collect form web for “Error running file in Container “error when loading shared libraries” DOCKER”

    The error tells you exactly what the problem is – you have copied over the executable, but it has dependencies on various libraries (including that aren’t in the container.

    You have two choices; you can add the dependencies to the container or you can recompile the executable so that it is statically linked.

    You can run the ldd tool on the executable to discover which dependencies it requires. You can then either copy the libraries directly into the container as you did with the executable or (probably better) you can find which package the dependencies are from and install with apt-get.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.