Docker Community Forums

Share and learn in the Docker community.

How to Install oracle jdk6 on ubuntu image

Hi All, I am building an image for a legacy software that requires jre 6 . I have downloaded oracle jdk 6 in the context directory of the build. My Dockerfile is like so

FROM ubuntu:16.04

RUN apt-get -y update
RUN apt-get install curl -y
RUN apt-get install wget -y
RUN cd /usr/local/
mkdir -p ./java/bin/java
COPY jdk-6u45-linux-x64.bin /usr/local/java/bin/java/
RUN chmod a+rwx -R /usr/local/java/bin/java/jdk-6u45-linux-x64.bin
ENV JAVA_HOME=/usr/local/java
RUN mkdir /usr/local/tomcat
RUN wget -O /tmp/tomcat.tar.gz
RUN cd /tmp && tar xvfz tomcat.tar.gz
RUN cp -Rv /tmp/apache-tomcat-7.0.108/* /usr/local/tomcat/
CMD ["/usr/local/tomcat/bin/", “run”]

When i try to run this image i get this error

/usr/local/tomcat/bin/ 1: exec: /usr/local/java/bin/java: Permission denied

What I’m I doing wrong?