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 add $(…):$(…) in Docker Compose
  • How to ADD all files/directories except a hidden directory like .git in Dockerfile
  • Amazons EC2 container service - are tasks deployed as docker containers inside docker containers?
  • Run Redis with persistent storage using docker-compose
  • Docker image builds on laptop, not on Digital Ocean - my understanding of Docker is shattered
  • Connecting webpack-dev-server inside a Docker container from the host
  • 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!

  • importerror:no module name docker.client
  • Bash - seamlessly run scripts with CRLF line endings
  • Kubernetes on Fedora 21 Pod Stays Pending
  • How can I install requirements.txt from docker-compose?
  • How do we start the daemon?
  • “chfn: PAM: System Error” Intermittently in Docker Hub Builds
  • 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.