Skip to content

Commit

Permalink
feat(java): use ppa with more versions (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice authored May 10, 2021
1 parent 926bcf1 commit d342d5c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Dockerfile.bionic
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions src/usr/local/buildpack/tools/java.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
24 changes: 22 additions & 2 deletions test/java/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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

0 comments on commit d342d5c

Please sign in to comment.