I have an image that is built using this dockerfile.
# vi Dockerfile
FROM openjdk:8
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp
I can login to container in interactive mode and type this command that works as expected.
java -jar /usr/src/myapp/dist/some.jar
But if I add this line to Dockerfile, I get an error:
CMD ["/usr/src/myapp/dist/some.jar", "java"]
docker: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused "exec: \" -jar /usr/src/myapp/dist/some.jar\": stat -jar /usr/src/myapp/dist/some.jar: no such file or directory".
How do I add the java command to dockerfile?