From 4cd3a6bd4b7684dd1f559c26ca0b02f051ef4587 Mon Sep 17 00:00:00 2001 From: Jim Van Fleet Date: Wed, 3 Aug 2016 14:04:13 -0400 Subject: [PATCH 1/4] Oracle JDK installed, not on path --- Dockerfile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 9463b0c..81594db 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 \ From 65088d481c9a28627f89a96c7a3b12862a6bbea8 Mon Sep 17 00:00:00 2001 From: Jim Van Fleet Date: Wed, 3 Aug 2016 14:18:17 -0400 Subject: [PATCH 2/4] Replaces OpenJDK with Oracle JDK --- Dockerfile | 2 ++ tests/shibboleth-idp.bats | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/Dockerfile b/Dockerfile index 81594db..64efaf0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,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/tests/shibboleth-idp.bats b/tests/shibboleth-idp.bats index 1d2820d..f7018be 100644 --- a/tests/shibboleth-idp.bats +++ b/tests/shibboleth-idp.bats @@ -21,6 +21,11 @@ setup() { [ "$status" -eq 0 ] } +@test "exports JAVA_HOME" { + result="$(docker run -i $maintainer/$imagename echo $JAVA_HOME)" + [ "$result" != "" ] +} + @test "Defers configuration via ONBUILD" { run grep ONBUILD Dockerfile [ "$status" -eq 0 ] From 411c14974739a710964e5ee3d845e87d37e3ecf5 Mon Sep 17 00:00:00 2001 From: Jim Van Fleet Date: Wed, 3 Aug 2016 14:38:37 -0400 Subject: [PATCH 3/4] Rebuilding in pipeline and hopefully speeding things up --- Jenkinsfile | 2 +- tests/shibboleth-idp.bats | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) 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 f7018be..a6d1478 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" != '' ] From 8faa9951e932b4f2ea7392c0ef5e50a1d420dc63 Mon Sep 17 00:00:00 2001 From: Jim Van Fleet Date: Wed, 3 Aug 2016 14:46:24 -0400 Subject: [PATCH 4/4] Changing mechanism for JAVA_HOME --- tests/shibboleth-idp.bats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/shibboleth-idp.bats b/tests/shibboleth-idp.bats index a6d1478..3528709 100644 --- a/tests/shibboleth-idp.bats +++ b/tests/shibboleth-idp.bats @@ -18,7 +18,7 @@ load ../common } @test "exports JAVA_HOME" { - result="$(docker run -i $maintainer/$imagename echo $JAVA_HOME)" + result="$(docker run -i $maintainer/$imagename env | grep JAVA_HOME)" [ "$result" != "" ] }