├── .github └── CODEOWNERS ├── .gitignore ├── README.md ├── updatecli ├── values.yaml └── updatecli.d │ ├── weekly.d │ ├── jdk8.yml │ ├── jdk11.yml │ ├── jdk17.yml │ ├── jdk21.yml │ ├── python3.yml │ ├── inboundimage.yml │ └── maven.yml │ └── daily.d │ └── launchable.yml ├── maven ├── jdk11 │ ├── cst-windows.yml │ └── Dockerfile.nanoserver ├── jdk17 │ ├── cst-windows.yml │ └── Dockerfile.nanoserver ├── jdk21 │ ├── cst-windows.yml │ └── Dockerfile.nanoserver └── jdk8 │ ├── cst-windows.yml │ └── Dockerfile.nanoserver ├── common-cst.yml ├── common-cst-windows.yml ├── LICENSE.txt └── Jenkinsfile_k8s /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @jenkinsci/team-docker-packaging 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.sw* 2 | build/ 3 | *.tar 4 | .tmp 5 | hadolint.json 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Jenkins Infra Docker Inbound Agents (Windows Maven) 2 | 3 | > [!CAUTION] 4 | > This repository and the associated Docker images are archived. 5 | > 6 | > More details in https://github.com/jenkins-infra/helpdesk/issues/4554. 7 | -------------------------------------------------------------------------------- /updatecli/values.yaml: -------------------------------------------------------------------------------- 1 | github: 2 | user: "Jenkins Infra Bot (updatecli)" 3 | email: "60776566+jenkins-infra-bot@users.noreply.github.com" 4 | username: "jenkins-infra-bot" 5 | token: "UPDATECLI_GITHUB_TOKEN" 6 | branch: "main" 7 | owner: "jenkins-infra" 8 | repository: "docker-inbound-agents" 9 | -------------------------------------------------------------------------------- /maven/jdk11/cst-windows.yml: -------------------------------------------------------------------------------- 1 | schemaVersion: 2.0.0 2 | 3 | commandTests: 4 | - name: "Check that `java` is present in the PATH and match jdk11" 5 | command: "cmd.exe" 6 | args: ["/C", "java", "--version"] 7 | expectedOutput: ["Temurin-11"] 8 | - name: "Check that `java 17` is present in C:/openjdk-17 for agent processes" 9 | command: "cmd.exe" 10 | args: ["/C", "C:/openjdk-17/bin/java", "--version"] 11 | expectedOutput: ["Temurin-17"] 12 | -------------------------------------------------------------------------------- /maven/jdk17/cst-windows.yml: -------------------------------------------------------------------------------- 1 | schemaVersion: 2.0.0 2 | 3 | commandTests: 4 | - name: "Check that `java` is present in the PATH and match jdk17" 5 | command: "cmd.exe" 6 | args: ["/C", "java", "--version"] 7 | expectedOutput: ["Temurin-17"] 8 | - name: "Check that `java 17` is present in C:/openjdk-17 for agent processes" 9 | command: "cmd.exe" 10 | args: ["/C", "C:/openjdk-17/bin/java", "--version"] 11 | expectedOutput: ["Temurin-17"] 12 | -------------------------------------------------------------------------------- /maven/jdk21/cst-windows.yml: -------------------------------------------------------------------------------- 1 | schemaVersion: 2.0.0 2 | 3 | commandTests: 4 | - name: "Check that `java` is present in the PATH and match jdk21" 5 | command: "cmd.exe" 6 | args: ["/C", "java", "--version"] 7 | expectedOutput: ["Temurin-21"] 8 | - name: "Check that `java 17` is present in C:/openjdk-17 for agent processes" 9 | command: "cmd.exe" 10 | args: ["/C", "C:/openjdk-17/bin/java", "--version"] 11 | expectedOutput: ["Temurin-17"] 12 | -------------------------------------------------------------------------------- /maven/jdk8/cst-windows.yml: -------------------------------------------------------------------------------- 1 | schemaVersion: 2.0.0 2 | 3 | commandTests: 4 | - name: "Check that `java` is present in the PATH and match jdk8" 5 | command: "cmd.exe" 6 | args: ["/C", "java", "-version"] 7 | # JDK8 prints to `stderr` - https://bugs.openjdk.org/browse/JDK-8166116 8 | expectedError: ["build 1.8.", "Temurin"] 9 | - name: "Check that `java 17` is present in C:/openjdk-17 for agent processes" 10 | command: "cmd.exe" 11 | args: ["/C", "C:/openjdk-17/bin/java", "--version"] 12 | expectedOutput: ["Temurin-17"] 13 | -------------------------------------------------------------------------------- /common-cst.yml: -------------------------------------------------------------------------------- 1 | schemaVersion: 2.0.0 2 | 3 | metadataTest: 4 | entrypoint: ["/usr/local/bin/jenkins-agent"] 5 | 6 | fileExistenceTests: 7 | 8 | - name: 'Jenkins agent' 9 | path: '/usr/local/bin/jenkins-agent' 10 | shouldExist: true 11 | isExecutableBy: 'any' 12 | - name: 'Jenkins agent jar file' 13 | path: '/usr/share/jenkins/agent.jar' 14 | shouldExist: true 15 | - name: "Default user's home" 16 | path: '/home/jenkins' 17 | shouldExist: true 18 | - name: 'Bash' 19 | path: '/bin/bash' 20 | shouldExist: true 21 | isExecutableBy: 'any' 22 | - name: 'Git' 23 | path: '/usr/bin/git' 24 | shouldExist: true 25 | isExecutableBy: 'any' 26 | 27 | 28 | fileContentTests: 29 | - name: 'Default user exists with the correct non-root UID/GID' 30 | path: '/etc/passwd' 31 | expectedContents: ['.*jenkins:x:100\d:100\d.*'] 32 | -------------------------------------------------------------------------------- /common-cst-windows.yml: -------------------------------------------------------------------------------- 1 | schemaVersion: 2.0.0 2 | 3 | metadataTest: 4 | entrypoint: ["pwsh.exe", "-f", "C:/ProgramData/Jenkins/jenkins-agent.ps1"] 5 | 6 | fileExistenceTests: 7 | - name: 'Jenkins agent' 8 | path: 'C:/ProgramData/Jenkins/jenkins-agent.ps1' 9 | shouldExist: true 10 | isExecutableBy: 'any' 11 | - name: 'Jenkins agent jar file' 12 | path: 'C:/ProgramData/Jenkins/agent.jar' 13 | shouldExist: true 14 | - name: "Default user's home" 15 | path: 'C:/users/jenkins/' 16 | shouldExist: true 17 | - name: "Launchable" 18 | path: 'C:/tools/python/Scripts/launchable.exe' 19 | shouldExist: true 20 | 21 | commandTests: 22 | - name: "Check that `git` is present in the PATH" 23 | command: "cmd.exe" 24 | args: ["/C", "git", "--version"] 25 | expectedOutput: ["git version .*"] 26 | - name: "Check that `python 3` is present in C:/tools/python" 27 | command: "cmd.exe" 28 | args: ["/C", "C:/tools/python/python.exe", "--version"] 29 | expectedOutput: ["Python 3.13.2"] 30 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2019 R Tyler Croy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /updatecli/updatecli.d/weekly.d/jdk8.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bump JDK8 version 3 | 4 | scms: 5 | default: 6 | kind: github 7 | spec: 8 | user: "{{ .github.user }}" 9 | email: "{{ .github.email }}" 10 | owner: "{{ .github.owner }}" 11 | repository: "{{ .github.repository }}" 12 | token: "{{ requiredEnv .github.token }}" 13 | username: "{{ .github.username }}" 14 | branch: "{{ .github.branch }}" 15 | 16 | sources: 17 | lastReleaseVersion: 18 | kind: githubrelease 19 | name: Get the latest Adoptium JDK8 version 20 | spec: 21 | owner: "adoptium" 22 | repository: "temurin8-binaries" 23 | token: "{{ requiredEnv .github.token }}" 24 | username: "{{ .github.username }}" 25 | versionfilter: 26 | kind: regex 27 | # (https://github.com/adoptium/temurin8-binaries/releases/tag/jdk8u345-b01) is OK but jdk8u302-b08.1 is not 28 | pattern: "^jdk8u(\\d*)-b(\\d*)$" 29 | 30 | targets: 31 | updateJDK8Version: 32 | name: Update the JDK8 version in the JDK8 Maven Nanoserver image 33 | kind: dockerfile 34 | spec: 35 | file: maven/jdk8/Dockerfile.nanoserver 36 | instruction: 37 | keyword: "ARG" 38 | matcher: "JAVA_VERSION" 39 | scmid: default 40 | 41 | actions: 42 | default: 43 | kind: github/pullrequest 44 | title: Bump JDK8 version to {{ source "lastReleaseVersion" }} 45 | scmid: default 46 | spec: 47 | labels: 48 | - enhancement 49 | - jdk8 50 | -------------------------------------------------------------------------------- /updatecli/updatecli.d/weekly.d/jdk11.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bump JDK11 version 3 | 4 | scms: 5 | default: 6 | kind: github 7 | spec: 8 | user: "{{ .github.user }}" 9 | email: "{{ .github.email }}" 10 | owner: "{{ .github.owner }}" 11 | repository: "{{ .github.repository }}" 12 | token: "{{ requiredEnv .github.token }}" 13 | username: "{{ .github.username }}" 14 | branch: "{{ .github.branch }}" 15 | 16 | sources: 17 | lastReleaseVersion: 18 | kind: githubrelease 19 | name: Get the latest Adoptium JDK11 version 20 | spec: 21 | owner: "adoptium" 22 | repository: "temurin11-binaries" 23 | token: "{{ requiredEnv .github.token }}" 24 | username: "{{ .github.username }}" 25 | versionfilter: 26 | kind: regex 27 | # jdk-11.0.12+7(https://github.com/adoptium/temurin11-binaries/releases/tag/jdk-11.0.12%2B7) is OK 28 | pattern: "^jdk-11.(\\d*).(\\d*).(\\d*)+(\\d*)$" 29 | 30 | targets: 31 | updateJDK11Version: 32 | name: Update the JDK11 version in JDK11 Maven Nanoserver image 33 | kind: dockerfile 34 | spec: 35 | file: maven/jdk11/Dockerfile.nanoserver 36 | instruction: 37 | keyword: "ARG" 38 | matcher: "JAVA_VERSION" 39 | scmid: default 40 | 41 | actions: 42 | default: 43 | kind: github/pullrequest 44 | title: Bump JDK11 version to {{ source "lastReleaseVersion" }} 45 | scmid: default 46 | spec: 47 | labels: 48 | - enhancement 49 | - jdk11 50 | -------------------------------------------------------------------------------- /updatecli/updatecli.d/weekly.d/jdk17.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bump JDK17 version 3 | 4 | scms: 5 | default: 6 | kind: github 7 | spec: 8 | user: "{{ .github.user }}" 9 | email: "{{ .github.email }}" 10 | owner: "{{ .github.owner }}" 11 | repository: "{{ .github.repository }}" 12 | token: "{{ requiredEnv .github.token }}" 13 | username: "{{ .github.username }}" 14 | branch: "{{ .github.branch }}" 15 | 16 | sources: 17 | lastReleaseVersion: 18 | kind: githubrelease 19 | name: Get the latest Adoptium JDK17 version 20 | spec: 21 | owner: "adoptium" 22 | repository: "temurin17-binaries" 23 | token: "{{ requiredEnv .github.token }}" 24 | username: "{{ .github.username }}" 25 | versionfilter: 26 | kind: regex 27 | # jdk-17.0.2+8(https://github.com/adoptium/temurin17-binaries/releases/tag/jdk-17.0.2%2B8) is OK 28 | # jdk-17.0.4.1+1(https://github.com/adoptium/temurin17-binaries/releases/tag/jdk-17.0.4.1%2B1) is OK 29 | pattern: "^jdk-17.(\\d*).(\\d*).(\\d*)(.(\\d*))+(\\d*)$" 30 | 31 | targets: 32 | updateJDK17Version: 33 | name: Update the JDK17 version in the JDK17 Maven Nanoserver image 34 | kind: dockerfile 35 | spec: 36 | file: maven/jdk17/Dockerfile.nanoserver 37 | instruction: 38 | keyword: "ARG" 39 | matcher: "JAVA_VERSION" 40 | scmid: default 41 | 42 | actions: 43 | default: 44 | kind: github/pullrequest 45 | title: Bump JDK17 version to {{ source "lastReleaseVersion" }} 46 | scmid: default 47 | spec: 48 | labels: 49 | - enhancement 50 | - jdk17 51 | -------------------------------------------------------------------------------- /updatecli/updatecli.d/weekly.d/jdk21.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bump JDK21 version 3 | 4 | scms: 5 | default: 6 | kind: github 7 | spec: 8 | user: "{{ .github.user }}" 9 | email: "{{ .github.email }}" 10 | owner: "{{ .github.owner }}" 11 | repository: "{{ .github.repository }}" 12 | token: "{{ requiredEnv .github.token }}" 13 | username: "{{ .github.username }}" 14 | branch: "{{ .github.branch }}" 15 | 16 | sources: 17 | lastReleaseVersion: 18 | kind: githubrelease 19 | name: Get the latest Adoptium JDK21 version 20 | spec: 21 | owner: "adoptium" 22 | repository: "temurin21-binaries" 23 | token: "{{ requiredEnv .github.token }}" 24 | username: "{{ .github.username }}" 25 | versionfilter: 26 | kind: regex 27 | # jdk-21.0.2+8(https://github.com/adoptium/temurin21-binaries/releases/tag/jdk-21.0.2%2B8) is OK 28 | # jdk-21.0.4.1+1(https://github.com/adoptium/temurin21-binaries/releases/tag/jdk-21.0.4.1%2B1) is OK 29 | pattern: "^jdk-21.(\\d*).(\\d*).(\\d*)(.(\\d*))+(\\d*)$" 30 | 31 | targets: 32 | updateJDK21Version: 33 | name: Update the JDK21 version in the JDK21 Maven Nanoserver image 34 | kind: dockerfile 35 | spec: 36 | file: maven/jdk21/Dockerfile.nanoserver 37 | instruction: 38 | keyword: "ARG" 39 | matcher: "JAVA_VERSION" 40 | scmid: default 41 | 42 | actions: 43 | default: 44 | kind: github/pullrequest 45 | title: Bump JDK21 version to {{ source "lastReleaseVersion" }} 46 | scmid: default 47 | spec: 48 | labels: 49 | - enhancement 50 | - jdk21 51 | -------------------------------------------------------------------------------- /Jenkinsfile_k8s: -------------------------------------------------------------------------------- 1 | properties([buildDiscarder(logRotator(daysToKeepStr: '15'))]) 2 | 3 | parallel( 4 | failFast: false, 5 | 'maven-jdk8-nanoserver': { 6 | buildDockerAndPublishImage('inbound-agent-maven:jdk8-nanoserver', [ 7 | dockerfile: 'maven/jdk8/Dockerfile.nanoserver', 8 | agentLabels: 'docker-windows-2019 && amd64', 9 | targetplatforms: 'windows/amd64', 10 | imageDir: 'maven/jdk8', 11 | ]) 12 | }, 13 | 'maven-jdk11-nanoserver': { 14 | buildDockerAndPublishImage('inbound-agent-maven:jdk11-nanoserver', [ 15 | dockerfile: 'maven/jdk11/Dockerfile.nanoserver', 16 | agentLabels: 'docker-windows-2019 && amd64', 17 | targetplatforms: 'windows/amd64', 18 | ]) 19 | }, 20 | 'maven-jdk17-nanoserver': { 21 | buildDockerAndPublishImage('inbound-agent-maven:jdk17-nanoserver', [ 22 | dockerfile: 'maven/jdk17/Dockerfile.nanoserver', 23 | agentLabels: 'docker-windows-2019 && amd64', 24 | targetplatforms: 'windows/amd64', 25 | imageDir: 'maven/jdk17', 26 | ]) 27 | }, 28 | 'maven-jdk21-nanoserver': { 29 | buildDockerAndPublishImage('inbound-agent-maven:jdk21-nanoserver', [ 30 | dockerfile: 'maven/jdk21/Dockerfile.nanoserver', 31 | agentLabels: 'docker-windows-2019 && amd64', 32 | targetplatforms: 'windows/amd64', 33 | imageDir: 'maven/jdk21', 34 | ]) 35 | }, 36 | 'updatecli': { 37 | // Test all configs 38 | updatecli(action: 'diff') 39 | if (env.BRANCH_IS_PRIMARY) { 40 | // Execute config daily or weekly depending on their folder 41 | updatecli(action: 'apply', config: './updatecli/updatecli.d/daily.d', cronTriggerExpression: '@daily') 42 | updatecli(action: 'apply', config: './updatecli/updatecli.d/weekly.d', cronTriggerExpression: '@weekly') 43 | } 44 | }, 45 | ) 46 | -------------------------------------------------------------------------------- /updatecli/updatecli.d/weekly.d/python3.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bump python3 version 3 | 4 | scms: 5 | default: 6 | kind: github 7 | spec: 8 | user: "{{ .github.user }}" 9 | email: "{{ .github.email }}" 10 | owner: "{{ .github.owner }}" 11 | repository: "{{ .github.repository }}" 12 | token: "{{ requiredEnv .github.token }}" 13 | username: "{{ .github.username }}" 14 | branch: "{{ .github.branch }}" 15 | 16 | sources: 17 | lastReleaseVersion: 18 | kind: shell 19 | name: Get the latest python3 version 20 | spec: 21 | command: curl https://endoflife.date/api/python.json --silent --show-error | jq -r '.[0].latest' 22 | 23 | conditions: 24 | ## Only check for chocolatey package 25 | checkForChocolateyPackage: 26 | kind: shell 27 | disablesourceinput: true # Do not pass source as argument to the command line 28 | spec: 29 | command: curl https://community.chocolatey.org/packages/python3/{{ source "lastReleaseVersion" }} --silent --show-error --location --fail --output /dev/null 30 | 31 | targets: 32 | updateVersion: 33 | name: "Update the python3 version in the Dockerfiles" 34 | sourceid: lastReleaseVersion 35 | scmid: default 36 | kind: file 37 | spec: 38 | files: 39 | - maven/jdk8/Dockerfile.nanoserver 40 | - maven/jdk11/Dockerfile.nanoserver 41 | - maven/jdk17/Dockerfile.nanoserver 42 | - maven/jdk21/Dockerfile.nanoserver 43 | matchpattern: > 44 | ARG PYTHON_VERSION=(.*) 45 | replacepattern: > 46 | ARG PYTHON_VERSION={{ source "lastReleaseVersion" }} 47 | updateTestHarness: 48 | name: "Update the python3 version in the test harness" 49 | sourceid: lastReleaseVersion 50 | scmid: default 51 | kind: file 52 | spec: 53 | file: common-cst-windows.yml 54 | matchpattern: > 55 | \["Python (.*)"] 56 | replacepattern: > 57 | ["Python {{ source "lastReleaseVersion" }}"] 58 | 59 | actions: 60 | default: 61 | kind: github/pullrequest 62 | title: Bump python3 version to {{ source "lastReleaseVersion" }} 63 | scmid: default 64 | spec: 65 | labels: 66 | - enhancement 67 | - python3 68 | -------------------------------------------------------------------------------- /updatecli/updatecli.d/daily.d/launchable.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bump launchable version 3 | 4 | scms: 5 | default: 6 | kind: github 7 | spec: 8 | user: "{{ .github.user }}" 9 | email: "{{ .github.email }}" 10 | owner: "{{ .github.owner }}" 11 | repository: "{{ .github.repository }}" 12 | token: "{{ requiredEnv .github.token }}" 13 | username: "{{ .github.username }}" 14 | branch: "{{ .github.branch }}" 15 | 16 | sources: 17 | getDeployedPackerImagesVersion: 18 | kind: yaml 19 | name: Retrieve the current version of the Packer images used in production in jenkins-infra/jenkins-infra 20 | spec: 21 | file: https://raw.githubusercontent.com/jenkins-infra/jenkins-infra/production/hieradata/common.yaml 22 | key: $.profile::jenkinscontroller::jcasc.agent_images.azure_vms_gallery_image.version 23 | # Retrieving Launchable from packer-images to synchronize its version across our infra 24 | getLaunchableVersionFromDeployedPackerImages: 25 | kind: file 26 | name: Get the latest Launchable version set in packer-images 27 | dependson: 28 | - getDeployedPackerImagesVersion 29 | spec: 30 | file: https://raw.githubusercontent.com/jenkins-infra/packer-images/{{ source "getDeployedPackerImagesVersion" }}/provisioning/tools-versions.yml 31 | matchpattern: 'launchable_version:\s(.*)' 32 | transformers: 33 | - findsubmatch: 34 | pattern: 'launchable_version:\s(.*)' 35 | captureindex: 1 36 | 37 | targets: 38 | updateVersion: 39 | name: "Update the launchable version in the Dockerfiles" 40 | sourceid: getLaunchableVersionFromDeployedPackerImages 41 | scmid: default 42 | kind: file 43 | spec: 44 | files: 45 | - maven/jdk8/Dockerfile.nanoserver 46 | - maven/jdk11/Dockerfile.nanoserver 47 | - maven/jdk17/Dockerfile.nanoserver 48 | - maven/jdk21/Dockerfile.nanoserver 49 | matchpattern: > 50 | ARG LAUNCHABLE_VERSION=(.*) 51 | replacepattern: > 52 | ARG LAUNCHABLE_VERSION={{ source "getLaunchableVersionFromDeployedPackerImages" }} 53 | 54 | actions: 55 | default: 56 | kind: github/pullrequest 57 | title: Bump launchable version to {{ source "getLaunchableVersionFromDeployedPackerImages" }} 58 | scmid: default 59 | spec: 60 | labels: 61 | - enhancement 62 | - launchable 63 | -------------------------------------------------------------------------------- /maven/jdk21/Dockerfile.nanoserver: -------------------------------------------------------------------------------- 1 | # escape=` 2 | ARG JAVA17_IMAGE_VERSION=3301.v4363ddcca_4e7-3 3 | ARG PYTHON_VERSION=3.13.2 4 | 5 | FROM python:"${PYTHON_VERSION}"-windowsservercore-1809 AS python-core 6 | 7 | # ProgressPreference => Disable Progress bar for faster downloads 8 | SHELL ["powershell.exe", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] 9 | 10 | # hadolint ignore=DL3013 11 | RUN "C:/Python/python.exe" -m pip install --no-cache-dir --upgrade pip; ` 12 | pip install --no-cache-dir setuptools wheel; 13 | 14 | # Adding jdk21 from Adoptium installers 15 | ARG JAVA_VERSION=jdk-21.0.6+7 16 | RUN New-Item -ItemType Directory -Path C:\temp | Out-Null ; ` 17 | $msiUrl = 'https://api.adoptium.net/v3/installer/version/{0}/windows/x64/jdk/hotspot/normal/eclipse?project=jdk' -f $env:JAVA_VERSION.Replace('+', '%2B') ; ` 18 | Invoke-WebRequest $msiUrl -OutFile 'C:\temp\jdk.msi' ; ` 19 | $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList '/i', 'C:\temp\jdk.msi', '/L*V', 'C:\temp\OpenJDK.log', '/quiet', 'ADDLOCAL=FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome', 'INSTALLDIR=C:\javaruntime' -Wait -Passthru ; ` 20 | $proc.WaitForExit() ; ` 21 | Remove-Item -Path C:\temp -Recurse | Out-Null 22 | 23 | # Use inbound-agent's jdk17 only for running jenkins agent, not as default java 24 | FROM jenkins/inbound-agent:"${JAVA17_IMAGE_VERSION}"-jdk17-nanoserver-1809 25 | 26 | # ProgressPreference => Disable Progress bar for faster downloads 27 | SHELL ["pwsh.exe", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] 28 | 29 | # Adding python 30 | COPY --from=python-core C:/Python C:/tools/python 31 | 32 | # Install Launchable in this layer 33 | ARG LAUNCHABLE_VERSION=1.66.0 34 | RUN "C:/tools/python/python.exe" -m pip install --no-cache-dir launchable=="${env:LAUNCHABLE_VERSION}"; 35 | 36 | ENV JAVA_HOME="C:\tools\jdk-21" 37 | COPY --from=python-core C:/javaruntime $JAVA_HOME 38 | 39 | # https://github.com/StefanScherer/dockerfiles-windows/tree/master/golang-issue-21867 40 | COPY --from=python-core C:/windows/system32/netapi32.dll C:/windows/system32/netapi32.dll 41 | COPY --from=python-core C:/windows/system32/whoami.exe C:/windows/system32/whoami.exe 42 | 43 | ARG MAVEN_VERSION=3.9.9 44 | RUN Invoke-WebRequest -Uri "https://archive.apache.org/dist/maven/maven-3/${env:MAVEN_VERSION}/binaries/apache-maven-${env:MAVEN_VERSION}-bin.zip" -OutFile ${env:TEMP}/apache-maven.zip ; ` 45 | Expand-Archive -Path "${env:TEMP}/apache-maven.zip -Destination" C:/tools ; ` 46 | Remove-Item ${env:TEMP}/apache-maven.zip ; 47 | 48 | ENV PYTHON_PATH="C:\tools\python;C:\tools\python\Scripts" 49 | ENV MAVEN_HOME="C:\tools\apache-maven-${MAVEN_VERSION}" 50 | ENV PATH="${PYTHON_PATH};${JAVA_HOME}\bin;${PATH};${MAVEN_HOME}\bin;" 51 | -------------------------------------------------------------------------------- /maven/jdk11/Dockerfile.nanoserver: -------------------------------------------------------------------------------- 1 | # escape=` 2 | ARG JAVA17_IMAGE_VERSION=3301.v4363ddcca_4e7-3 3 | ARG PYTHON_VERSION=3.13.2 4 | 5 | FROM python:"${PYTHON_VERSION}"-windowsservercore-1809 AS python-core 6 | 7 | # ProgressPreference => Disable Progress bar for faster downloads 8 | SHELL ["powershell.exe", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] 9 | 10 | # hadolint ignore=DL3013 11 | RUN "C:/Python/python.exe" -m pip install --no-cache-dir --upgrade pip; ` 12 | pip install --no-cache-dir setuptools wheel; 13 | 14 | # Adding jdk11 from Adoptium MSI installer (cannot only run msiexec.exe on ServerCore, NOT on nanoserver) 15 | ARG JAVA_VERSION=jdk-11.0.26+4 16 | RUN New-Item -ItemType Directory -Path C:\temp | Out-Null ; ` 17 | $msiUrl = 'https://api.adoptium.net/v3/installer/version/{0}/windows/x64/jdk/hotspot/normal/eclipse?project=jdk' -f $env:JAVA_VERSION.Replace('+', '%2B') ; ` 18 | Invoke-WebRequest $msiUrl -OutFile 'C:\temp\jdk.msi' ; ` 19 | $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList '/i', 'C:\temp\jdk.msi', '/L*V', 'C:\temp\OpenJDK.log', '/quiet', 'ADDLOCAL=FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome', 'INSTALLDIR=C:\javaruntime' -Wait -Passthru ; ` 20 | $proc.WaitForExit() ; ` 21 | Remove-Item -Path C:\temp -Recurse | Out-Null 22 | 23 | # Use inbound-agent's jdk17 only for running jenkins agent, not as default java 24 | FROM jenkins/inbound-agent:"${JAVA17_IMAGE_VERSION}"-jdk17-nanoserver-1809 25 | 26 | # ProgressPreference => Disable Progress bar for faster downloads 27 | SHELL ["pwsh.exe", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] 28 | 29 | # Adding python 30 | COPY --from=python-core C:/Python C:/tools/python 31 | 32 | # Install Launchable in this layer 33 | ARG LAUNCHABLE_VERSION=1.66.0 34 | RUN "C:/tools/python/python.exe" -m pip install --no-cache-dir launchable=="${env:LAUNCHABLE_VERSION}"; 35 | 36 | ENV JAVA_HOME="C:\tools\jdk-11" 37 | COPY --from=python-core C:/javaruntime $JAVA_HOME 38 | 39 | # https://github.com/StefanScherer/dockerfiles-windows/tree/master/golang-issue-21867 40 | COPY --from=python-core C:/windows/system32/netapi32.dll C:/windows/system32/netapi32.dll 41 | COPY --from=python-core C:/windows/system32/whoami.exe C:/windows/system32/whoami.exe 42 | 43 | ARG MAVEN_VERSION=3.9.9 44 | RUN Invoke-WebRequest -Uri "https://archive.apache.org/dist/maven/maven-3/${env:MAVEN_VERSION}/binaries/apache-maven-${env:MAVEN_VERSION}-bin.zip" -OutFile ${env:TEMP}/apache-maven.zip ; ` 45 | Expand-Archive -Path "${env:TEMP}/apache-maven.zip -Destination" C:/tools ; ` 46 | Remove-Item ${env:TEMP}/apache-maven.zip ; 47 | 48 | ENV PYTHON_PATH="C:\tools\python;C:\tools\python\Scripts" 49 | ENV MAVEN_HOME="C:\tools\apache-maven-${MAVEN_VERSION}" 50 | ENV PATH="${PYTHON_PATH};${JAVA_HOME}\bin;${PATH};${MAVEN_HOME}\bin;" 51 | -------------------------------------------------------------------------------- /maven/jdk17/Dockerfile.nanoserver: -------------------------------------------------------------------------------- 1 | # escape=` 2 | ARG JAVA17_IMAGE_VERSION=3301.v4363ddcca_4e7-3 3 | ARG PYTHON_VERSION=3.13.2 4 | 5 | FROM python:"${PYTHON_VERSION}"-windowsservercore-1809 AS python-core 6 | 7 | # ProgressPreference => Disable Progress bar for faster downloads 8 | SHELL ["powershell.exe", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] 9 | 10 | # hadolint ignore=DL3013 11 | RUN "C:/Python/python.exe" -m pip install --no-cache-dir --upgrade pip; ` 12 | pip install --no-cache-dir setuptools wheel; 13 | 14 | # Adding jdk17 from Adoptium MSI installer (cannot only run msiexec.exe on ServerCore, NOT on nanoserver) 15 | ARG JAVA_VERSION=jdk-17.0.14+7 16 | RUN New-Item -ItemType Directory -Path C:\temp | Out-Null ; ` 17 | $msiUrl = 'https://api.adoptium.net/v3/installer/version/{0}/windows/x64/jdk/hotspot/normal/eclipse?project=jdk' -f $env:JAVA_VERSION.Replace('+', '%2B') ; ` 18 | Invoke-WebRequest $msiUrl -OutFile 'C:\temp\jdk.msi' ; ` 19 | $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList '/i', 'C:\temp\jdk.msi', '/L*V', 'C:\temp\OpenJDK.log', '/quiet', 'ADDLOCAL=FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome', 'INSTALLDIR=C:\javaruntime' -Wait -Passthru ; ` 20 | $proc.WaitForExit() ; ` 21 | Remove-Item -Path C:\temp -Recurse | Out-Null 22 | 23 | # Use inbound-agent's jdk17 only for running jenkins agent, not as default java 24 | FROM jenkins/inbound-agent:"${JAVA17_IMAGE_VERSION}"-jdk17-nanoserver-1809 25 | 26 | # ProgressPreference => Disable Progress bar for faster downloads 27 | SHELL ["pwsh.exe", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] 28 | 29 | # Adding python 30 | COPY --from=python-core C:/Python C:/tools/python 31 | 32 | # Install Launchable in this layer 33 | ARG LAUNCHABLE_VERSION=1.66.0 34 | RUN "C:/tools/python/python.exe" -m pip install --no-cache-dir launchable=="${env:LAUNCHABLE_VERSION}"; 35 | 36 | ENV JAVA_HOME="C:\tools\jdk-17" 37 | COPY --from=python-core C:/javaruntime $JAVA_HOME 38 | 39 | # https://github.com/StefanScherer/dockerfiles-windows/tree/master/golang-issue-21867 40 | COPY --from=python-core C:/windows/system32/netapi32.dll C:/windows/system32/netapi32.dll 41 | COPY --from=python-core C:/windows/system32/whoami.exe C:/windows/system32/whoami.exe 42 | 43 | ARG MAVEN_VERSION=3.9.9 44 | RUN Invoke-WebRequest -Uri "https://archive.apache.org/dist/maven/maven-3/${env:MAVEN_VERSION}/binaries/apache-maven-${env:MAVEN_VERSION}-bin.zip" -OutFile ${env:TEMP}/apache-maven.zip ; ` 45 | Expand-Archive -Path "${env:TEMP}/apache-maven.zip -Destination" C:/tools ; ` 46 | Remove-Item ${env:TEMP}/apache-maven.zip ; 47 | 48 | ENV PYTHON_PATH="C:\tools\python;C:\tools\python\Scripts" 49 | ENV MAVEN_HOME="C:\tools\apache-maven-${MAVEN_VERSION}" 50 | ENV PATH="${PYTHON_PATH};${JAVA_HOME}\bin;${PATH};${MAVEN_HOME}\bin;" 51 | -------------------------------------------------------------------------------- /maven/jdk8/Dockerfile.nanoserver: -------------------------------------------------------------------------------- 1 | # escape=` 2 | ARG JAVA17_IMAGE_VERSION=3301.v4363ddcca_4e7-3 3 | ARG PYTHON_VERSION=3.13.2 4 | 5 | FROM python:"${PYTHON_VERSION}"-windowsservercore-1809 AS python-core 6 | 7 | # ProgressPreference => Disable Progress bar for faster downloads 8 | SHELL ["powershell.exe", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] 9 | 10 | # hadolint ignore=DL3013 11 | RUN "C:/Python/python.exe" -m pip install --no-cache-dir --upgrade pip; ` 12 | pip install --no-cache-dir setuptools wheel; 13 | 14 | # Adding jdk8 from Adoptium MSI installer (cannot only run msiexec.exe on ServerCore, NOT on nanoserver) 15 | # WARNING: JDK8 has a different URL pattern than the others (/jdk8<...>/ instead of /jdk-17<...>/) 16 | ARG JAVA_VERSION=jdk8u442-b06 17 | RUN New-Item -ItemType Directory -Path C:\temp | Out-Null ; ` 18 | $msiUrl = 'https://api.adoptium.net/v3/installer/version/{0}/windows/x64/jdk/hotspot/normal/eclipse?project=jdk' -f $env:JAVA_VERSION.Replace('+', '%2B') ; ` 19 | Invoke-WebRequest $msiUrl -OutFile 'C:\temp\jdk.msi' ; ` 20 | $proc = Start-Process -FilePath 'msiexec.exe' -ArgumentList '/i', 'C:\temp\jdk.msi', '/L*V', 'C:\temp\OpenJDK.log', '/quiet', 'ADDLOCAL=FeatureEnvironment,FeatureJarFileRunWith,FeatureJavaHome', 'INSTALLDIR=C:\javaruntime' -Wait -Passthru ; ` 21 | $proc.WaitForExit() ; ` 22 | Remove-Item -Path C:\temp -Recurse | Out-Null 23 | 24 | # Use inbound-agent's jdk17 only for running jenkins agent, not as default java 25 | FROM jenkins/inbound-agent:${JAVA17_IMAGE_VERSION}-jdk17-nanoserver-1809 26 | 27 | # ProgressPreference => Disable Progress bar for faster downloads 28 | SHELL ["pwsh.exe", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] 29 | 30 | # Adding python 31 | COPY --from=python-core C:/Python C:/tools/python 32 | 33 | # Install Launchable in this layer 34 | ARG LAUNCHABLE_VERSION=1.66.0 35 | RUN "C:/tools/python/python.exe" -m pip install --no-cache-dir launchable=="${env:LAUNCHABLE_VERSION}"; 36 | 37 | # Adding jdk8 from eclipse-temurin 38 | ENV JAVA_HOME="C:\tools\jdk-8" 39 | COPY --from=python-core C:/javaruntime $JAVA_HOME 40 | 41 | # https://github.com/StefanScherer/dockerfiles-windows/tree/master/golang-issue-21867 42 | COPY --from=python-core C:/windows/system32/netapi32.dll C:/windows/system32/netapi32.dll 43 | COPY --from=python-core C:/windows/system32/whoami.exe C:/windows/system32/whoami.exe 44 | 45 | ARG MAVEN_VERSION=3.9.9 46 | RUN Invoke-WebRequest -Uri "https://archive.apache.org/dist/maven/maven-3/${env:MAVEN_VERSION}/binaries/apache-maven-${env:MAVEN_VERSION}-bin.zip" -OutFile ${env:TEMP}/apache-maven.zip ; ` 47 | Expand-Archive -Path "${env:TEMP}/apache-maven.zip -Destination" C:/tools ; ` 48 | Remove-Item ${env:TEMP}/apache-maven.zip ; 49 | 50 | ENV PYTHON_PATH="C:\tools\python;C:\tools\python\Scripts" 51 | ENV MAVEN_HOME="C:\tools\apache-maven-${MAVEN_VERSION}" 52 | ENV PATH="${PYTHON_PATH};${JAVA_HOME}\bin;${PATH};${MAVEN_HOME}\bin;" 53 | -------------------------------------------------------------------------------- /updatecli/updatecli.d/weekly.d/inboundimage.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bump inbound-agent (jdk17-nanoserver-1809) container image version 3 | 4 | scms: 5 | default: 6 | kind: github 7 | spec: 8 | user: "{{ .github.user }}" 9 | email: "{{ .github.email }}" 10 | owner: "{{ .github.owner }}" 11 | repository: "{{ .github.repository }}" 12 | token: "{{ requiredEnv .github.token }}" 13 | username: "{{ .github.username }}" 14 | branch: "{{ .github.branch }}" 15 | 16 | sources: 17 | lastReleaseVersion: 18 | kind: githubrelease 19 | name: Get the latest jenkinsci:docker-inbound-agent 20 | spec: 21 | owner: "jenkinsci" 22 | repository: "docker-agent" 23 | token: "{{ requiredEnv .github.token }}" 24 | username: "{{ .github.username }}" 25 | versionfilter: 26 | kind: regex 27 | #3077.vd69cf116da_6f-3 28 | ## not the JDK8 version - regex from https://stackoverflow.com/questions/16398471/regex-for-string-not-ending-with-given-suffix/16398502#16398502 29 | pattern: '.*[^-][^j][^d][^k][^8]$' 30 | 31 | conditions: 32 | checkDockerImagePublished: 33 | name: "Is latest dockerfile docker-inbound-agent image published?" 34 | kind: dockerimage 35 | disablesourceinput: true 36 | spec: 37 | image: "jenkins/inbound-agent" 38 | architecture: "amd64" 39 | tag: '{{ source "lastReleaseVersion" }}-jdk17-nanoserver-1809' 40 | 41 | targets: 42 | updateJDK8: 43 | name: Update inbound-agent (jdk17-nanoserver-1809) container image version for JDK8 image 44 | scmid: default 45 | kind: dockerfile 46 | spec: 47 | file: maven/jdk8/Dockerfile.nanoserver 48 | instruction: 49 | keyword: "ARG" 50 | matcher: "JAVA17_IMAGE_VERSION" 51 | updateJDK11: 52 | name: Update inbound-agent (jdk17-nanoserver-1809) container image version for JDK11 image 53 | scmid: default 54 | kind: dockerfile 55 | spec: 56 | file: maven/jdk11/Dockerfile.nanoserver 57 | instruction: 58 | keyword: "ARG" 59 | matcher: "JAVA17_IMAGE_VERSION" 60 | updateJDK17: 61 | name: Update inbound-agent (jdk17-nanoserver-1809) container image version for JDK17 image 62 | scmid: default 63 | kind: dockerfile 64 | spec: 65 | file: maven/jdk17/Dockerfile.nanoserver 66 | instruction: 67 | keyword: "ARG" 68 | matcher: "JAVA17_IMAGE_VERSION" 69 | updateJDK21: 70 | name: Update inbound-agent (jdk17-nanoserver-1809) container image version for JDK21 image 71 | scmid: default 72 | kind: dockerfile 73 | spec: 74 | file: maven/jdk21/Dockerfile.nanoserver 75 | instruction: 76 | keyword: "ARG" 77 | matcher: "JAVA17_IMAGE_VERSION" 78 | 79 | actions: 80 | default: 81 | kind: github/pullrequest 82 | title: Bump inbound-agent (jdk17) container image version to {{ source "lastReleaseVersion" }} 83 | scmid: default 84 | spec: 85 | labels: 86 | - enhancement 87 | - inbound-agent 88 | -------------------------------------------------------------------------------- /updatecli/updatecli.d/weekly.d/maven.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "Bump Maven version" 3 | 4 | scms: 5 | default: 6 | kind: github 7 | spec: 8 | user: "{{ .github.user }}" 9 | email: "{{ .github.email }}" 10 | owner: "{{ .github.owner }}" 11 | repository: "{{ .github.repository }}" 12 | token: "{{ requiredEnv .github.token }}" 13 | username: "{{ .github.username }}" 14 | branch: "{{ .github.branch }}" 15 | 16 | sources: 17 | getPackerImageDeployedVersion: 18 | kind: yaml 19 | name: Retrieve the current version of the Packer images used in production 20 | spec: 21 | file: https://raw.githubusercontent.com/jenkins-infra/jenkins-infra/production/hieradata/common.yaml 22 | key: $.profile::jenkinscontroller::jcasc.agent_images.azure_vms_gallery_image.version 23 | # Retrieving Maven from packer-images to synchronize its version across our infra 24 | # See https://github.com/jenkins-infra/docker-inbound-agents/issues/18 25 | getMavenVersionFromPackerImages: 26 | kind: file 27 | name: Get the latest Maven version set in packer-images 28 | dependson: 29 | - getPackerImageDeployedVersion 30 | spec: 31 | file: https://raw.githubusercontent.com/jenkins-infra/packer-images/{{ source "getPackerImageDeployedVersion" }}/provisioning/tools-versions.yml 32 | matchpattern: 'maven_version:\s(.*)' 33 | transformers: 34 | - findsubmatch: 35 | pattern: 'maven_version:\s(.*)' 36 | captureindex: 1 37 | 38 | conditions: 39 | checkIfReleaseIsAvailable: 40 | kind: shell 41 | disablesourceinput: true 42 | spec: 43 | command: curl --connect-timeout 5 --location --head --fail --silent --show-error https://archive.apache.org/dist/maven/maven-3/{{ source `getMavenVersionFromPackerImages` }}/binaries/apache-maven-{{ source `getMavenVersionFromPackerImages` }}-bin.tar.gz 44 | 45 | targets: 46 | updateMavenJdk8NanoserverVersion: 47 | name: Update the Maven version for the JDK8 nanoserver container image 48 | kind: dockerfile 49 | sourceid: getMavenVersionFromPackerImages 50 | spec: 51 | file: maven/jdk8/Dockerfile.nanoserver 52 | instruction: 53 | keyword: "ARG" 54 | matcher: "MAVEN_VERSION" 55 | scmid: default 56 | updateMavenJdk11NanoserverVersion: 57 | name: Update the Maven version for the JDK11 container image 58 | kind: dockerfile 59 | sourceid: getMavenVersionFromPackerImages 60 | spec: 61 | file: maven/jdk11/Dockerfile.nanoserver 62 | instruction: 63 | keyword: "ARG" 64 | matcher: "MAVEN_VERSION" 65 | scmid: default 66 | updateMavenJdk17NanoserverVersion: 67 | name: Update the Maven version for the JDK17 container image 68 | kind: dockerfile 69 | sourceid: getMavenVersionFromPackerImages 70 | spec: 71 | file: maven/jdk17/Dockerfile.nanoserver 72 | instruction: 73 | keyword: "ARG" 74 | matcher: "MAVEN_VERSION" 75 | scmid: default 76 | updateMavenJdk21NanoserverVersion: 77 | name: Update the Maven version for the JDK21 container image 78 | kind: dockerfile 79 | sourceid: getMavenVersionFromPackerImages 80 | spec: 81 | file: maven/jdk21/Dockerfile.nanoserver 82 | instruction: 83 | keyword: "ARG" 84 | matcher: "MAVEN_VERSION" 85 | scmid: default 86 | 87 | actions: 88 | default: 89 | kind: github/pullrequest 90 | scmid: default 91 | title: Bump Maven version to {{ source "getMavenVersionFromPackerImages" }} 92 | spec: 93 | labels: 94 | - dependencies 95 | - maven 96 | --------------------------------------------------------------------------------