From d342d5c2bc44539fb20a6f57f0aaf82ac3cacd70 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 10 May 2021 21:45:22 +0200 Subject: [PATCH] feat(java): use ppa with more versions (#38) --- Dockerfile.bionic | 4 ++-- src/usr/local/buildpack/tools/java.sh | 7 +++++++ test/java/Dockerfile | 24 ++++++++++++++++++++++-- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/Dockerfile.bionic b/Dockerfile.bionic index de18adc2c..a189672f2 100644 --- a/Dockerfile.bionic +++ b/Dockerfile.bionic @@ -47,8 +47,8 @@ RUN install-tool golang 1.16.4 # renovate: datasource=github-releases lookupName=helm/helm RUN install-tool helm v3.5.4 -# renovate: datasource=docker lookupName=openjdk versioning=java -RUN install-tool java 11 +# renovate: datasource=docker lookupName=openjdk versioning=docker +RUN install-tool java 11.0.11 # renovate: datasource=gradle-version lookupName=gradle versioning=gradle RUN install-tool gradle 6.9 diff --git a/src/usr/local/buildpack/tools/java.sh b/src/usr/local/buildpack/tools/java.sh index cfdd84237..7a16f06a4 100644 --- a/src/usr/local/buildpack/tools/java.sh +++ b/src/usr/local/buildpack/tools/java.sh @@ -5,6 +5,13 @@ set -e require_root check_semver $TOOL_VERSION +VERSION_CODENAME=$(. /etc/os-release && echo ${VERSION_CODENAME}) + +echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu ${VERSION_CODENAME} main" | tee -a /etc/apt/sources.list.d/java.list +curl -sSL \ + 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xDA1A4A13543B466853BAF164EB9B1D8886F44E2A' \ + | apt-key add - + apt_install openjdk-${MAJOR}-jdk-headless java -version diff --git a/test/java/Dockerfile b/test/java/Dockerfile index 9bf217b9c..8bf7a3ed6 100644 --- a/test/java/Dockerfile +++ b/test/java/Dockerfile @@ -1,8 +1,8 @@ ARG IMAGE=containerbase/buildpack FROM ${IMAGE} as build -# renovate: datasource=docker lookupName=openjdk versioning=java -RUN install-tool java 11 +# renovate: datasource=docker lookupName=openjdk versioning=docker +RUN install-tool java 11.0.11 RUN touch /.dummy @@ -31,9 +31,29 @@ RUN set -ex; \ SHELL [ "/bin/sh", "-c" ] RUN gradle --version +#-------------------------------------- +# test: java 8 +#-------------------------------------- +FROM build as testb + + +# renovate: datasource=docker lookupName=openjdk versioning=docker +RUN install-tool java 8 + +#-------------------------------------- +# test: java 16 +#-------------------------------------- +FROM build as testc + + +# renovate: datasource=docker lookupName=openjdk versioning=docker +RUN install-tool java 16.0.1 + #-------------------------------------- # final #-------------------------------------- FROM build COPY --from=testa /.dummy /.dummy +COPY --from=testb /.dummy /.dummy +COPY --from=testc /.dummy /.dummy