Installing Oracle Java 11 on Alpine Linux with Docker

Viewed 1399

I am trying to configure Alpine with Oracle JDK. I have downloaded the JDK and am copying it into my image and using it there.

When I run which java it reports back the correct path /jdk-11.0.10/bin/java but when I try to run any java command it says it is not found.

I tried to reference some info from

https://wiki.alpinelinux.org/wiki/Installing_Oracle_Java

WRT how to do this but I'm not having any luck.

Any input would be appreciated!

FROM alpine

RUN apk add freetype fontconfig paxctl
COPY jdk-11.0.10_linux-x64_bin.tar.gz /

RUN tar -xf jdk-11.0.10_linux-x64_bin.tar.gz

ENV JAVA_HOME /jdk-11.0.10
ENV PATH ${JAVA_HOME}/bin:${PATH}
CMD echo ${PATH}
CMD echo which java
RUN paxctl -c java
RUN paxctl -m java
RUN paxctl -c javac
RUN paxctl -m javac
CMD java -version
0 Answers
Related