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 export JAVA_HOME
RUN mkdir /usr/local/tomcat
RUN wget https://mirror.kiu.ac.ug/apache/tomcat/tomcat-7/v7.0.108/bin/apache-tomcat-7.0.108.tar.gz -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/
EXPOSE 8080
CMD ["/usr/local/tomcat/bin/catalina.sh", “run”]

When i try to run this image i get this error

/usr/local/tomcat/bin/catalina.sh: 1: exec: /usr/local/java/bin/java: Permission denied

What I’m I doing wrong?