I’m new to Docker so I hope my question won’t sound too odd for you.
I want to create a docker image that contains a .jar-file, a downloaded jdk/jre package, a .yml-file (settings for the .jar-file) and a Dockerfile. When running the Dockerfile Docker should extract the jdk/jre package and start the java-file with certain arguments.
I’m working on Ubuntu 14.04.05, my Docker is 17.03.1-ce (API version: 1.27).
My working directory:
ADD . /app
ENV NAME Transliteration
RUN tar -xvzf server-jre-8u131-linux-x64.tar.gz
ENV JAVA_HOME /app/jdk.1.8.0_131/
RUN ls -l /app/jdk1.8.0_131/bin
RUN /app/jdk.1.8.0_131/bin/java -version
CMD ["/app/jdk.1.8.0_131/bin/java -version"]
The error i get: /bin/sh: /app/jdk.1.8.0_131/bin/java: not found
So it seems that the java executable cannot be found, but a ls -l /app does give the correct folder structure (/app/jdk…/bin/java). What is the problem here?