diff --git a/Dockerfile b/Dockerfile index 9463b0c..64efaf0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,10 +16,19 @@ LABEL ImageName=$imagename LABEL ImageOS=centos7 LABEL Version=$VERSION +ENV JAVA_VERSION 8u101 +ENV BUILD_VERSION b13 + +RUN 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-8-linux-x64.rpm && \ + yum -y install /tmp/jdk-8-linux-x64.rpm && \ + rm -f /tmp/jdk-8-linux-x64.rpm && \ + alternatives --install /usr/bin/java jar /usr/java/latest/bin/java 200000 && \ + alternatives --install /usr/bin/javaws javaws /usr/java/latest/bin/javaws 200000 && \ + alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 200000 + RUN yum -y install \ apr-devel \ httpd \ - java-1.8.0-openjdk-headless \ krb5-workstation \ mod_ssl \ openssl-devel \ @@ -30,6 +39,8 @@ RUN yum -y install \ ENV SHIB_RELDIR=http://shibboleth.net/downloads/identity-provider/$VERSION ENV SHIB_PREFIX=shibboleth-identity-provider-$VERSION +ENV JAVA_HOME /usr/java/latest +ENV PATH $JAVA_HOME/bin:$PATH RUN mkdir -p /tmp/shibboleth && cd /tmp/shibboleth && \ wget -q https://shibboleth.net/downloads/PGP_KEYS \ diff --git a/Jenkinsfile b/Jenkinsfile index 4e56680..2dda60c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,7 +27,7 @@ node { echo "Building ${maintainer}:${tag} for ${maintainer}" } - sh 'bin/build.sh' + sh 'bin/rebuild.sh' stage 'Tests' diff --git a/tests/shibboleth-idp.bats b/tests/shibboleth-idp.bats index 1d2820d..3528709 100644 --- a/tests/shibboleth-idp.bats +++ b/tests/shibboleth-idp.bats @@ -2,10 +2,6 @@ load ../common -setup() { - ./bin/rebuild.sh -} - @test "Creates non-root Shib IDP home" { result="$(docker run -i $maintainer/$imagename ls /opt/shibboleth/current/bin/)" [ "$result" != '' ] @@ -21,6 +17,11 @@ setup() { [ "$status" -eq 0 ] } +@test "exports JAVA_HOME" { + result="$(docker run -i $maintainer/$imagename env | grep JAVA_HOME)" + [ "$result" != "" ] +} + @test "Defers configuration via ONBUILD" { run grep ONBUILD Dockerfile [ "$status" -eq 0 ]