I have the following error while trying to run:
$ docker run my-app-11
docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"java -jar /opt/my-app-1.0-SNAPSHOT.jar\": stat java -jar /opt/my-app-1.0-SNAPSHOT.jar: no such file or directory": unknown.
The Dockerfile I used to create an image is the following:
FROM anapsix/alpine-java
COPY target/my-app-1.0-SNAPSHOT.jar /opt/my-app-1.0-SNAPSHOT.jar
WORKDIR /opt
CMD ["java -jar /opt/my-app-1.0-SNAPSHOT.jar"]
When I enter into container and run the command it works well:
$ docker run -it my-app-11 /bin/bash
bash-4.4# java -jar /opt/my-app-1.0-SNAPSHOT.jar
Hello World!