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:-
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:-
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.
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: