From 71a0feb12bf1cfa38e0bfae43de68f9ecf72bd59 Mon Sep 17 00:00:00 2001 From: Jim Van Fleet Date: Tue, 8 Nov 2016 16:21:38 -0500 Subject: [PATCH] Installing Java --- Dockerfile | 14 +++----------- .../bin/install_oracle_jdk.sh | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 11 deletions(-) create mode 100755 additional_container_files/bin/install_oracle_jdk.sh diff --git a/Dockerfile b/Dockerfile index 98811cc..8dc9602 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM tier/grouper +FROM tier/grouper:move-from-openjdk ARG maintainer=my ARG imagename=grouper @@ -7,17 +7,9 @@ ARG version=2.3.0 LABEL Version=$version ENV VERSION=$version ENV TOMCAT_VERSION="6.0.35" +ENV JAVA_HOME=/usr/java/latest -ADD ./container_files /opt/ -COPY conf/grouper.conf /etc/httpd/conf.d/grouper.conf -COPY conf/grouper.hibernate.properties /opt/etc -RUN rm /opt/grouper/2.3.0/grouper.apiBinary-2.3.0/conf/grouper.hibernate.properties && \ - ln -s /opt/etc/grouper.hibernate.properties /opt/grouper/2.3.0/grouper.apiBinary-2.3.0/conf/grouper.hibernate.properties && \ - rm /opt/grouper/2.3.0/grouper.ws-2.3.0/grouper-ws/build/dist/grouper-ws/WEB-INF/classes/grouper.hibernate.properties && \ - ln -s /opt/etc/grouper.hibernate.properties /opt/grouper/2.3.0/grouper.ws-2.3.0/grouper-ws/build/dist/grouper-ws/WEB-INF/classes/grouper.hibernate.properties && \ - rm /opt/grouper/2.3.0/grouper.ui-2.3.0/dist/grouper/WEB-INF/classes/grouper.hibernate.properties && \ - ln -s /opt/etc/grouper.hibernate.properties /opt/grouper/2.3.0/grouper.ui-2.3.0/dist/grouper/WEB-INF/classes/grouper.hibernate.properties && \ - /opt/autoexec/bin/onbuild.sh +RUN yum remove -y java-1.8.0-openjdk java-1.8.0-openjdk-devel && /opt/bin/install_oracle_jdk.sh VOLUME /opt/grouper/$version/apache-tomcat-$TOMCAT_VERSION/logs VOLUME /etc/httpd/logs diff --git a/additional_container_files/bin/install_oracle_jdk.sh b/additional_container_files/bin/install_oracle_jdk.sh new file mode 100755 index 0000000..d53df31 --- /dev/null +++ b/additional_container_files/bin/install_oracle_jdk.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Override this file with a version with the following commented out in order to use Oracle JDK. + +# Uncomment all the following lines to download the JDK to your Shibboleth IDP image. By uncommenting these lines, you agree to the Oracle Binary Code License Agreement for Java SE (http://www.oracle.com/technetwork/java/javase/terms/license/index.html) + +JAVA_VERSION=7u79 +BUILD_VERSION=b15 +JAVA_HOME=/usr/java/latest + +wget -nv --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/$JAVA_VERSION-$BUILD_VERSION/jdk-$JAVA_VERSION-linux-x64.rpm" -O /tmp/jdk-7-linux-x64.rpm && \ + yum -y install /tmp/jdk-7-linux-x64.rpm && \ + rm -f /tmp/jdk-7-linux-x64.rpm && \ + alternatives --install /usr/bin/java jar $JAVA_HOME/bin/java 200000 && \ + alternatives --install /usr/bin/javaws javaws $JAVA_HOME/bin/javaws 200000 && \ + alternatives --install /usr/bin/javac javac $JAVA_HOME/bin/javac 200000 \ No newline at end of file