From 4cef1b8a0d6d2035e8aa52a7c9445801bc54c70a Mon Sep 17 00:00:00 2001 From: Tim Jacomb <21194782+timja@users.noreply.github.com> Date: Tue, 28 Sep 2021 07:22:27 +0100 Subject: [PATCH] Add java 17 preview (#243) * Add java 17 preview * Add required args * Minor fixes after testing * Looks like agents don't need these flags (at least in simple tests) * Update docker-bake.hcl --- 17/debian/Dockerfile | 15 +++++++++++++++ docker-bake.hcl | 18 +++++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 17/debian/Dockerfile diff --git a/17/debian/Dockerfile b/17/debian/Dockerfile new file mode 100644 index 00000000..1539bf2f --- /dev/null +++ b/17/debian/Dockerfile @@ -0,0 +1,15 @@ +ARG version=4.10-6-jdk17-preview +FROM jenkins/agent:$version + +ARG version +LABEL Description="This is a base image, which allows connecting Jenkins agents via JNLP protocols" Vendor="Jenkins project" Version="$version" + +ARG user=jenkins + +USER root +COPY ../../jenkins-agent /usr/local/bin/jenkins-agent +RUN chmod +x /usr/local/bin/jenkins-agent &&\ + ln -s /usr/local/bin/jenkins-agent /usr/local/bin/jenkins-slave +USER ${user} + +ENTRYPOINT ["/usr/local/bin/jenkins-agent"] diff --git a/docker-bake.hcl b/docker-bake.hcl index 107cc17c..e67a4abc 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -4,12 +4,14 @@ group "linux" { "alpine_jdk11", "debian_jdk8", "debian_jdk11", + "debian_jdk17", ] } group "linux-arm64" { targets = [ "debian_jdk11", + "debian_jdk17", ] } @@ -23,7 +25,7 @@ group "linux-ppc64le" { # update this to use a newer build number for jenkins/docker image variable "AGENT_IMAGE_BUILD_NUMBER" { - default = "4" + default = "6" } variable "REGISTRY" { @@ -106,3 +108,17 @@ target "debian_jdk11" { ] platforms = ["linux/amd64", "linux/arm64", "linux/s390x"] } + +target "debian_jdk17" { + dockerfile = "17/debian/Dockerfile" + context = "." + args = { + version = "${REMOTING_VERSION}-${AGENT_IMAGE_BUILD_NUMBER}-jdk17-preview" + } + tags = [ + equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-jdk17-preview": "", + "${REGISTRY}/${JENKINS_REPO}:jdk17-preview", + "${REGISTRY}/${JENKINS_REPO}:latest-jdk17-preview", + ] + platforms = ["linux/amd64", "linux/arm64"] +}