docker run complains file not found

I am running following command for build docker image from /etc/docker and all files I want to copy inside the container are at this same location

docker build -t user/testapp .

Following is the content of my Dockerfile:-

  • How to get a docker history from an image that has not been pulled yet?
  • Configuring Hipache with etcd
  • How to make request to server running on docker
  • Dockerized selenium browser cannot access Capybara test url
  • Spring Templates in Docker Container
  • How do I get environment variables to persist into an imported Docker image
  • FROM openjdk:alpine
    COPY . /usr/src/testapp/
    WORKDIR /usr/src/testapp/
    CMD TestAppStart
    

    Image builds fine but when running it uwing following command it says:-
    /bin/sh: /usr/src/testmq/TestAppStart
    I also tried absolute path in CMD but same error.

    I have verified that the files are getting copied by changing CMD to /bin/sh the container starts and I get a shell inside it and I can navigate to that directory and see all the files and can even run the TestAppStart from there manually.

    Need help!

  • Remote API for docker exec commands
  • Temporary disabling exposed ports on Docker
  • Options -Indexes not working in .htaccess file in Docker continer
  • Unable to remove tag of a docker image due to 'no such image' error
  • How to Host Ghost Blog on Home Web Server
  • docker, where is the aufs root for the docker container
  • One Solution collect form web for “docker run complains file not found”

    The /usr/src/testapp/ directory is not in the PATH environment variable, so /bin/sh complains.

    Change the last line to:

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