From e4a9e1c6e56883185c5edcf8811fe97b30017885 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Sat, 22 Oct 2022 10:41:09 +0200 Subject: [PATCH 1/8] fix: remove non JDK8 builds and tests Signed-off-by: Damien Duportal --- .github/dependabot.yml | 93 +-------------- 11/alpine/Dockerfile | 63 ---------- 11/archlinux/Dockerfile | 78 ------------- 11/bullseye/Dockerfile | 83 -------------- 11/windows/nanoserver-1809/Dockerfile | 108 ------------------ .../windowsservercore-ltsc2019/Dockerfile | 93 --------------- 17/alpine/Dockerfile | 62 ---------- 17/bullseye/Dockerfile | 84 -------------- 17/windows/nanoserver-1809/Dockerfile | 108 ------------------ .../windowsservercore-ltsc2019/Dockerfile | 93 --------------- Makefile | 2 +- README.md | 12 +- build-windows.yaml | 20 ---- docker-bake.hcl | 104 ----------------- tests/agent.Tests.ps1 | 7 -- tests/tests.bats | 2 +- 16 files changed, 6 insertions(+), 1006 deletions(-) delete mode 100644 11/alpine/Dockerfile delete mode 100644 11/archlinux/Dockerfile delete mode 100644 11/bullseye/Dockerfile delete mode 100644 11/windows/nanoserver-1809/Dockerfile delete mode 100644 11/windows/windowsservercore-ltsc2019/Dockerfile delete mode 100644 17/alpine/Dockerfile delete mode 100644 17/bullseye/Dockerfile delete mode 100644 17/windows/nanoserver-1809/Dockerfile delete mode 100644 17/windows/windowsservercore-ltsc2019/Dockerfile diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 32bfba13b..098ac57e4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,28 +4,6 @@ updates: # Alpine Linux -- package-ecosystem: docker - directory: "17/alpine" - schedule: - interval: weekly - open-pull-requests-limit: 2 - target-branch: master - reviewers: - - MarkEWaite - labels: - - dependencies - -- package-ecosystem: docker - directory: "11/alpine" - schedule: - interval: weekly - open-pull-requests-limit: 2 - target-branch: master - reviewers: - - MarkEWaite - labels: - - dependencies - - package-ecosystem: docker directory: "8/alpine" schedule: @@ -37,43 +15,8 @@ updates: labels: - dependencies -# Arch Linux - -- package-ecosystem: docker - directory: "11/archlinux" - schedule: - interval: weekly - open-pull-requests-limit: 2 - target-branch: master - reviewers: - - MarkEWaite - labels: - - dependencies - # Debian Linux -- package-ecosystem: docker - directory: "17/bullseye" - schedule: - interval: weekly - open-pull-requests-limit: 2 - target-branch: master - reviewers: - - MarkEWaite - labels: - - dependencies - -- package-ecosystem: docker - directory: "11/bullseye" - schedule: - interval: weekly - open-pull-requests-limit: 2 - target-branch: master - reviewers: - - MarkEWaite - labels: - - dependencies - - package-ecosystem: docker directory: "8/bullseye" schedule: @@ -88,29 +31,7 @@ updates: # Windows - package-ecosystem: docker - directory: "17/windows/nanoserver-1809" - schedule: - interval: weekly - open-pull-requests-limit: 2 - target-branch: master - reviewers: - - slide - labels: - - dependencies - -- package-ecosystem: docker - directory: "17/windows/windowsservercore-ltsc2019" - schedule: - interval: weekly - open-pull-requests-limit: 2 - target-branch: master - reviewers: - - slide - labels: - - dependencies - -- package-ecosystem: docker - directory: "11/windows/nanoserver-1809" + directory: "8/windows/windowsservercore-ltsc2019" schedule: interval: weekly open-pull-requests-limit: 2 @@ -120,19 +41,9 @@ updates: labels: - dependencies -- package-ecosystem: docker - directory: "11/windows/windowsservercore-ltsc2019" - schedule: - interval: weekly - open-pull-requests-limit: 2 - target-branch: master - reviewers: - - slide - labels: - - dependencies - package-ecosystem: docker - directory: "8/windows/windowsservercore-ltsc2019" + directory: "8/windows/nanoserver-1809" schedule: interval: weekly open-pull-requests-limit: 2 diff --git a/11/alpine/Dockerfile b/11/alpine/Dockerfile deleted file mode 100644 index d1e77355f..000000000 --- a/11/alpine/Dockerfile +++ /dev/null @@ -1,63 +0,0 @@ -# The MIT License -# -# Copyright (c) 2015-2020, CloudBees, Inc. and other Jenkins contributors -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -ARG JAVA_VERSION="11.0.16.1_1" -FROM eclipse-temurin:${JAVA_VERSION}-jdk-alpine - -ARG VERSION=4.13 -ARG user=jenkins -ARG group=jenkins -ARG uid=1000 -ARG gid=1000 - -RUN addgroup -g ${gid} ${group} -RUN adduser -h /home/${user} -u ${uid} -G ${group} -D ${user} -LABEL Description="This is a base image, which provides the Jenkins agent executable (slave.jar)" Vendor="Jenkins project" Version="${VERSION}" - -ARG AGENT_WORKDIR=/home/${user}/agent - -ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' - -RUN apk add --update --no-cache curl bash git git-lfs musl-locales openssh-client openssl procps \ - && curl --create-dirs -fsSLo /usr/share/jenkins/agent.jar https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar \ - && chmod 755 /usr/share/jenkins \ - && chmod 644 /usr/share/jenkins/agent.jar \ - && ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar \ - && apk del --purge curl \ - && rm -rf /tmp/*.apk /tmp/gcc /tmp/gcc-libs.tar* /tmp/libz /tmp/libz.tar.xz /var/cache/apk/* - -USER ${user} -ENV AGENT_WORKDIR=${AGENT_WORKDIR} -RUN mkdir /home/${user}/.jenkins && mkdir -p ${AGENT_WORKDIR} - -VOLUME /home/${user}/.jenkins -VOLUME ${AGENT_WORKDIR} -WORKDIR /home/${user} - -LABEL \ - org.opencontainers.image.vendor="Jenkins project" \ - org.opencontainers.image.title="Official Jenkins Agent Base Docker image" \ - org.opencontainers.image.description="This is a base image, which provides the Jenkins agent executable (agent.jar)" \ - org.opencontainers.image.version="${VERSION}" \ - org.opencontainers.image.url="https://www.jenkins.io/" \ - org.opencontainers.image.source="https://github.com/jenkinsci/docker-agent" \ - org.opencontainers.image.licenses="MIT" diff --git a/11/archlinux/Dockerfile b/11/archlinux/Dockerfile deleted file mode 100644 index 8ccead591..000000000 --- a/11/archlinux/Dockerfile +++ /dev/null @@ -1,78 +0,0 @@ -# The MIT License -# -# Copyright (c) 2015-2020, CloudBees, Inc. and other Jenkins contributors -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -FROM archlinux:latest AS jre-build - -RUN pacman -Syu jdk11-openjdk --noconfirm - -# Generate smaller java runtime without unneeded files -# for now we include the full module path to maintain compatibility -# while still saving space (approx 200mb from the full distribution) -RUN /usr/lib/jvm/default-runtime/bin/jlink \ - --add-modules ALL-MODULE-PATH \ - --strip-debug \ - --no-man-pages \ - --no-header-files \ - --compress=2 \ - --output /javaruntime - -FROM archlinux:latest - -ARG VERSION=4.13 -ARG user=jenkins -ARG group=jenkins -ARG uid=1000 -ARG gid=1000 - -RUN groupadd -g ${gid} ${group} -RUN useradd -c "Jenkins user" -d /home/${user} -u ${uid} -g ${gid} -m ${user} -LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" - -ARG AGENT_WORKDIR=/home/${user}/agent - -RUN pacman -Syu git git-lfs --noconfirm - -RUN curl --create-dirs -fsSLo /usr/share/jenkins/agent.jar https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar \ - && chmod 755 /usr/share/jenkins \ - && chmod 644 /usr/share/jenkins/agent.jar \ - && ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar - -ENV JAVA_HOME=/opt/java/openjdk -ENV PATH "${JAVA_HOME}/bin:${PATH}" -COPY --from=jre-build /javaruntime $JAVA_HOME - -USER ${user} -ENV AGENT_WORKDIR=${AGENT_WORKDIR} -RUN mkdir /home/${user}/.jenkins && mkdir -p ${AGENT_WORKDIR} - -VOLUME /home/${user}/.jenkins -VOLUME ${AGENT_WORKDIR} -WORKDIR /home/${user} - -LABEL \ - org.opencontainers.image.vendor="Jenkins project" \ - org.opencontainers.image.title="Official Jenkins Agent Base Docker image" \ - org.opencontainers.image.description="This is a base image, which provides the Jenkins agent executable (agent.jar)" \ - org.opencontainers.image.version="${VERSION}" \ - org.opencontainers.image.url="https://www.jenkins.io/" \ - org.opencontainers.image.source="https://github.com/jenkinsci/docker-agent" \ - org.opencontainers.image.licenses="MIT" diff --git a/11/bullseye/Dockerfile b/11/bullseye/Dockerfile deleted file mode 100644 index 747c74f21..000000000 --- a/11/bullseye/Dockerfile +++ /dev/null @@ -1,83 +0,0 @@ -# The MIT License -# -# Copyright (c) 2015-2020, CloudBees, Inc. and other Jenkins contributors -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -FROM eclipse-temurin:11.0.16.1_1-jdk-focal AS jre-build - -# Generate smaller java runtime without unneeded files -# for now we include the full module path to maintain compatibility -# while still saving space (approx 200mb from the full distribution) -RUN jlink \ - --add-modules ALL-MODULE-PATH \ - --strip-debug \ - --no-man-pages \ - --no-header-files \ - --compress=2 \ - --output /javaruntime - -FROM debian:bullseye-20220912 - -ARG VERSION=4.13 -ARG user=jenkins -ARG group=jenkins -ARG uid=1000 -ARG gid=1000 - -RUN groupadd -g ${gid} ${group} -RUN useradd -c "Jenkins user" -d /home/${user} -u ${uid} -g ${gid} -m ${user} -LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" - -ARG AGENT_WORKDIR=/home/${user}/agent - -RUN apt-get update \ - && apt-get -y install \ - git-lfs \ - curl \ - fontconfig \ - && curl --create-dirs -fsSLo /usr/share/jenkins/agent.jar https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar \ - && chmod 755 /usr/share/jenkins \ - && chmod 644 /usr/share/jenkins/agent.jar \ - && ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar \ - && apt-get remove -y curl \ - && rm -rf /var/lib/apt/lists/* - -ENV LANG C.UTF-8 - -ENV JAVA_HOME=/opt/java/openjdk -ENV PATH "${JAVA_HOME}/bin:${PATH}" -COPY --from=jre-build /javaruntime $JAVA_HOME - -USER ${user} -ENV AGENT_WORKDIR=${AGENT_WORKDIR} -RUN mkdir /home/${user}/.jenkins && mkdir -p ${AGENT_WORKDIR} - -VOLUME /home/${user}/.jenkins -VOLUME ${AGENT_WORKDIR} -WORKDIR /home/${user} - -LABEL \ - org.opencontainers.image.vendor="Jenkins project" \ - org.opencontainers.image.title="Official Jenkins Agent Base Docker image" \ - org.opencontainers.image.description="This is a base image, which provides the Jenkins agent executable (agent.jar)" \ - org.opencontainers.image.version="${VERSION}" \ - org.opencontainers.image.url="https://www.jenkins.io/" \ - org.opencontainers.image.source="https://github.com/jenkinsci/docker-agent" \ - org.opencontainers.image.licenses="MIT" diff --git a/11/windows/nanoserver-1809/Dockerfile b/11/windows/nanoserver-1809/Dockerfile deleted file mode 100644 index ac7349d94..000000000 --- a/11/windows/nanoserver-1809/Dockerfile +++ /dev/null @@ -1,108 +0,0 @@ -# escape=` - -# The MIT License -# -# Copyright (c) 2020, Alex Earl and other Jenkins Contributors -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -ARG JAVA_VERSION="11.0.16.1_1" -FROM eclipse-temurin:${JAVA_VERSION}-jdk-windowsservercore-1809 AS core - -# If you pass in a POWERSHELL_VERSION, make sure it ends with a hyphen, leaving it empty will -# use the 'latest' -ARG POWERSHELL_VERSION= -FROM mcr.microsoft.com/powershell:${POWERSHELL_VERSION}nanoserver-1809 - -ARG JAVA_VERSION -ARG JAVA_HOME="C:\openjdk-11" - -# The nanoserver image is nice and small, but we need a couple of things to get SSH working -COPY --from=core /windows/system32/netapi32.dll /windows/system32/netapi32.dll -COPY --from=core /windows/system32/whoami.exe /windows/system32/whoami.exe -COPY --from=core $JAVA_HOME $JAVA_HOME - -SHELL ["pwsh.exe", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -USER ContainerAdministrator - -ARG GIT_VERSION=2.37.2 -ARG GIT_PATCH_VERSION=2 -RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` - $url = $('https://github.com/git-for-windows/git/releases/download/v{0}.windows.{1}/MinGit-{0}.{1}-64-bit.zip' -f $env:GIT_VERSION, $env:GIT_PATCH_VERSION) ; ` - Write-Host "Retrieving $url..." ; ` - Invoke-WebRequest $url -OutFile 'mingit.zip' -UseBasicParsing ; ` - Expand-Archive mingit.zip -DestinationPath c:\mingit ; ` - Remove-Item mingit.zip -Force - -ARG GIT_LFS_VERSION=3.1.4 -RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` - $url = $('https://github.com/git-lfs/git-lfs/releases/download/v{0}/git-lfs-windows-amd64-v{0}.zip' -f $env:GIT_LFS_VERSION) ; ` - Write-Host "Retrieving $url..." ; ` - Invoke-WebRequest $url -OutFile 'GitLfs.zip' -UseBasicParsing ; ` - Expand-Archive GitLfs.zip -DestinationPath c:\mingit\mingw64\bin ; ` - Remove-Item GitLfs.zip -Force ; ` - & C:\mingit\cmd\git.exe lfs install - -ENV ProgramFiles="C:\Program Files" ` - WindowsPATH="C:\Windows\system32;C:\Windows" ` - JAVA_HOME="${JAVA_HOME}" -ENV PATH="${WindowsPATH};${ProgramFiles}\PowerShell;${JAVA_HOME}\bin;C:\mingit\cmd" - -ARG user=jenkins - -ARG AGENT_FILENAME=agent.jar -ARG AGENT_HASH_FILENAME=$AGENT_FILENAME.sha1 - -RUN net accounts /maxpwage:unlimited ; ` - net user "$env:user" /add /expire:never /passwordreq:no ; ` - net localgroup Administrators /add $env:user ; ` - New-Item -ItemType Directory -Path C:/ProgramData/Jenkins | Out-Null - -ARG AGENT_ROOT=C:/Users/$user -ARG AGENT_WORKDIR=${AGENT_ROOT}/Work - -ENV AGENT_WORKDIR=${AGENT_WORKDIR} - -# Get the Agent from the Jenkins Artifacts Repository -ARG VERSION=4.13 -LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" -RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` - Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar' -f $env:VERSION) -OutFile $(Join-Path C:/ProgramData/Jenkins $env:AGENT_FILENAME) -UseBasicParsing ; ` - Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar.sha1' -f $env:VERSION) -OutFile (Join-Path C:/ProgramData/Jenkins $env:AGENT_HASH_FILENAME) -UseBasicParsing ; ` - if ((Get-FileHash (Join-Path C:/ProgramData/Jenkins $env:AGENT_FILENAME) -Algorithm SHA1).Hash -ne (Get-Content (Join-Path C:/ProgramData/Jenkins $env:AGENT_HASH_FILENAME))) {exit 1} ; ` - Remove-Item -Force (Join-Path C:/ProgramData/Jenkins $env:AGENT_HASH_FILENAME) - -USER $user - -RUN New-Item -Type Directory $('{0}/.jenkins' -f $env:AGENT_ROOT) | Out-Null ; ` - New-Item -Type Directory $env:AGENT_WORKDIR | Out-Null - -RUN git config --global core.longpaths true - -VOLUME ${AGENT_ROOT}/.jenkins -VOLUME ${AGENT_WORKDIR} -WORKDIR ${AGENT_ROOT} - -LABEL ` - org.opencontainers.image.vendor="Jenkins project" ` - org.opencontainers.image.title="Official Jenkins Agent Base Docker image" ` - org.opencontainers.image.description="This is a base image, which provides the Jenkins agent executable (agent.jar)" ` - org.opencontainers.image.version="${VERSION}" ` - org.opencontainers.image.url="https://www.jenkins.io/" ` - org.opencontainers.image.source="https://github.com/jenkinsci/docker-agent" ` - org.opencontainers.image.licenses="MIT" diff --git a/11/windows/windowsservercore-ltsc2019/Dockerfile b/11/windows/windowsservercore-ltsc2019/Dockerfile deleted file mode 100644 index 45a2c7412..000000000 --- a/11/windows/windowsservercore-ltsc2019/Dockerfile +++ /dev/null @@ -1,93 +0,0 @@ -# escape=` - -# The MIT License -# -# Copyright (c) 2020, Alex Earl and other Jenkins Contributors -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -FROM eclipse-temurin:11.0.16.1_1-jdk-windowsservercore-1809 - -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] - -ARG GIT_VERSION=2.37.2 -ARG GIT_PATCH_VERSION=2 -RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` - $url = $('https://github.com/git-for-windows/git/releases/download/v{0}.windows.{1}/MinGit-{0}.{1}-64-bit.zip' -f $env:GIT_VERSION, $env:GIT_PATCH_VERSION) ; ` - Write-Host "Retrieving $url..." ; ` - Invoke-WebRequest $url -OutFile 'mingit.zip' -UseBasicParsing ; ` - Expand-Archive mingit.zip -DestinationPath c:\mingit ; ` - Remove-Item mingit.zip -Force - -ARG GIT_LFS_VERSION=3.1.4 -RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` - $url = $('https://github.com/git-lfs/git-lfs/releases/download/v{0}/git-lfs-windows-amd64-v{0}.zip' -f $env:GIT_LFS_VERSION) ; ` - Write-Host "Retrieving $url..." ; ` - Invoke-WebRequest $url -OutFile 'GitLfs.zip' -UseBasicParsing ; ` - Expand-Archive GitLfs.zip -DestinationPath c:\mingit\mingw64\bin ; ` - Remove-Item GitLfs.zip -Force ; ` - & C:\mingit\cmd\git.exe lfs install ; ` - $CurrentPath = (Get-Itemproperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path).Path ; ` - $NewPath = $CurrentPath + ';C:\mingit\cmd' ; ` - Set-ItemProperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path -Value $NewPath - -ARG user=jenkins - -ARG AGENT_FILENAME=agent.jar -ARG AGENT_HASH_FILENAME=$AGENT_FILENAME.sha1 - -RUN net accounts /maxpwage:unlimited ; ` - net user "$env:user" /add /expire:never /passwordreq:no ; ` - net localgroup Administrators /add $env:user ; ` - Set-LocalUser -Name $env:user -PasswordNeverExpires 1; ` - New-Item -ItemType Directory -Path C:/ProgramData/Jenkins | Out-Null - -ARG AGENT_ROOT=C:/Users/$user -ARG AGENT_WORKDIR=${AGENT_ROOT}/Work - -ENV AGENT_WORKDIR=${AGENT_WORKDIR} - -# Get the Agent from the Jenkins Artifacts Repository -ARG VERSION=4.13 -LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" -RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` - Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar' -f $env:VERSION) -OutFile $(Join-Path C:/ProgramData/Jenkins $env:AGENT_FILENAME) -UseBasicParsing ; ` - Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar.sha1' -f $env:VERSION) -OutFile (Join-Path C:/ProgramData/Jenkins $env:AGENT_HASH_FILENAME) -UseBasicParsing ; ` - if ((Get-FileHash (Join-Path C:/ProgramData/Jenkins $env:AGENT_FILENAME) -Algorithm SHA1).Hash -ne (Get-Content (Join-Path C:/ProgramData/Jenkins $env:AGENT_HASH_FILENAME))) {exit 1} ; ` - Remove-Item -Force (Join-Path C:/ProgramData/Jenkins $env:AGENT_HASH_FILENAME) - -USER $user - -RUN New-Item -Type Directory $('{0}/.jenkins' -f $env:AGENT_ROOT) | Out-Null ; ` - New-Item -Type Directory $env:AGENT_WORKDIR | Out-Null - -RUN git config --global core.longpaths true - -VOLUME ${AGENT_ROOT}/.jenkins -VOLUME ${AGENT_WORKDIR} -WORKDIR ${AGENT_ROOT} - -LABEL ` - org.opencontainers.image.vendor="Jenkins project" ` - org.opencontainers.image.title="Official Jenkins Agent Base Docker image" ` - org.opencontainers.image.description="This is a base image, which provides the Jenkins agent executable (agent.jar)" ` - org.opencontainers.image.version="${VERSION}" ` - org.opencontainers.image.url="https://www.jenkins.io/" ` - org.opencontainers.image.source="https://github.com/jenkinsci/docker-agent" ` - org.opencontainers.image.licenses="MIT" diff --git a/17/alpine/Dockerfile b/17/alpine/Dockerfile deleted file mode 100644 index f6a418f81..000000000 --- a/17/alpine/Dockerfile +++ /dev/null @@ -1,62 +0,0 @@ -# The MIT License -# -# Copyright (c) 2015-2020, CloudBees, Inc. and other Jenkins contributors -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -ARG JAVA_VERSION="17.0.4.1_1" -FROM eclipse-temurin:${JAVA_VERSION}-jdk-alpine - -ARG VERSION=4.13 -ARG user=jenkins -ARG group=jenkins -ARG uid=1000 -ARG gid=1000 - -RUN addgroup -g ${gid} ${group} -RUN adduser -h /home/${user} -u ${uid} -G ${group} -D ${user} -LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" - -ARG AGENT_WORKDIR=/home/${user}/agent - -ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8' - -RUN apk add --update --no-cache curl bash git git-lfs musl-locales openssh-client openssl procps \ - && curl --create-dirs -fsSLo /usr/share/jenkins/agent.jar https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar \ - && chmod 755 /usr/share/jenkins \ - && chmod 644 /usr/share/jenkins/agent.jar \ - && ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar \ - && apk del --purge curl \ - && rm -rf /tmp/*.apk /tmp/gcc /tmp/gcc-libs.tar* /tmp/libz /tmp/libz.tar.xz /var/cache/apk/* - -USER ${user} -ENV AGENT_WORKDIR=${AGENT_WORKDIR} -RUN mkdir /home/${user}/.jenkins && mkdir -p ${AGENT_WORKDIR} - -VOLUME /home/${user}/.jenkins -VOLUME ${AGENT_WORKDIR} -WORKDIR /home/${user} - -LABEL \ - org.opencontainers.image.vendor="Jenkins project" \ - org.opencontainers.image.title="Official Jenkins Agent Base Docker image" \ - org.opencontainers.image.description="This is a base image, which provides the Jenkins agent executable (agent.jar)" \ - org.opencontainers.image.version="${VERSION}" \ - org.opencontainers.image.url="https://www.jenkins.io/" \ - org.opencontainers.image.source="https://github.com/jenkinsci/docker-agent" \ - org.opencontainers.image.licenses="MIT" diff --git a/17/bullseye/Dockerfile b/17/bullseye/Dockerfile deleted file mode 100644 index df3f5ecbd..000000000 --- a/17/bullseye/Dockerfile +++ /dev/null @@ -1,84 +0,0 @@ -# The MIT License -# -# Copyright (c) 2015-2021, CloudBees, Inc. and other Jenkins contributors -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -# To avoid "jmods: Value too large for defined data type" error, -FROM --platform=$BUILDPLATFORM eclipse-temurin:17.0.4.1_1-jdk-focal AS jre-build - -# Generate smaller java runtime without unneeded files -# for now we include the full module path to maintain compatibility -# while still saving space (approx 200mb from the full distribution) -RUN jlink \ - --add-modules ALL-MODULE-PATH \ - --strip-java-debug-attributes \ - --no-man-pages \ - --no-header-files \ - --compress=2 \ - --output /javaruntime - -FROM debian:bullseye-20220912 - -ARG VERSION=4.13 -ARG user=jenkins -ARG group=jenkins -ARG uid=1000 -ARG gid=1000 - -RUN groupadd -g ${gid} ${group} -RUN useradd -c "Jenkins user" -d /home/${user} -u ${uid} -g ${gid} -m ${user} -LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" - -ARG AGENT_WORKDIR=/home/${user}/agent - -RUN apt-get update \ - && apt-get -y install \ - git-lfs \ - curl \ - fontconfig \ - && curl --create-dirs -fsSLo /usr/share/jenkins/agent.jar https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar \ - && chmod 755 /usr/share/jenkins \ - && chmod 644 /usr/share/jenkins/agent.jar \ - && ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar \ - && apt-get remove -y curl \ - && rm -rf /var/lib/apt/lists/* - -ENV LANG C.UTF-8 - -ENV JAVA_HOME=/opt/java/openjdk -ENV PATH "${JAVA_HOME}/bin:${PATH}" -COPY --from=jre-build /javaruntime $JAVA_HOME - -USER ${user} -ENV AGENT_WORKDIR=${AGENT_WORKDIR} -RUN mkdir /home/${user}/.jenkins && mkdir -p ${AGENT_WORKDIR} - -VOLUME /home/${user}/.jenkins -VOLUME ${AGENT_WORKDIR} -WORKDIR /home/${user} - -LABEL \ - org.opencontainers.image.vendor="Jenkins project" \ - org.opencontainers.image.title="Official Jenkins Agent Base Docker image" \ - org.opencontainers.image.description="This is a base image, which provides the Jenkins agent executable (agent.jar)" \ - org.opencontainers.image.version="${VERSION}" \ - org.opencontainers.image.url="https://www.jenkins.io/" \ - org.opencontainers.image.source="https://github.com/jenkinsci/docker-agent" \ - org.opencontainers.image.licenses="MIT" diff --git a/17/windows/nanoserver-1809/Dockerfile b/17/windows/nanoserver-1809/Dockerfile deleted file mode 100644 index d7572fa57..000000000 --- a/17/windows/nanoserver-1809/Dockerfile +++ /dev/null @@ -1,108 +0,0 @@ -# escape=` - -# The MIT License -# -# Copyright (c) 2020, Alex Earl and other Jenkins Contributors -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. -ARG JAVA_VERSION="17.0.4.1_1" -FROM eclipse-temurin:${JAVA_VERSION}-jdk-windowsservercore-1809 AS core - -# If you pass in a POWERSHELL_VERSION, make sure it ends with a hyphen, leaving it empty will -# use the 'latest' -ARG POWERSHELL_VERSION= -FROM mcr.microsoft.com/powershell:${POWERSHELL_VERSION}nanoserver-1809 - -ARG JAVA_VERSION -ARG JAVA_HOME="C:\openjdk-17" - -# The nanoserver image is nice and small, but we need a couple of things to get SSH working -COPY --from=core /windows/system32/netapi32.dll /windows/system32/netapi32.dll -COPY --from=core /windows/system32/whoami.exe /windows/system32/whoami.exe -COPY --from=core $JAVA_HOME $JAVA_HOME - -SHELL ["pwsh.exe", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] -USER ContainerAdministrator - -ARG GIT_VERSION=2.37.2 -ARG GIT_PATCH_VERSION=2 -RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` - $url = $('https://github.com/git-for-windows/git/releases/download/v{0}.windows.{1}/MinGit-{0}.{1}-64-bit.zip' -f $env:GIT_VERSION, $env:GIT_PATCH_VERSION) ; ` - Write-Host "Retrieving $url..." ; ` - Invoke-WebRequest $url -OutFile 'mingit.zip' -UseBasicParsing ; ` - Expand-Archive mingit.zip -DestinationPath c:\mingit ; ` - Remove-Item mingit.zip -Force - -ARG GIT_LFS_VERSION=3.1.4 -RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` - $url = $('https://github.com/git-lfs/git-lfs/releases/download/v{0}/git-lfs-windows-amd64-v{0}.zip' -f $env:GIT_LFS_VERSION) ; ` - Write-Host "Retrieving $url..." ; ` - Invoke-WebRequest $url -OutFile 'GitLfs.zip' -UseBasicParsing ; ` - Expand-Archive GitLfs.zip -DestinationPath c:\mingit\mingw64\bin ; ` - Remove-Item GitLfs.zip -Force ; ` - & C:\mingit\cmd\git.exe lfs install - -ENV ProgramFiles="C:\Program Files" ` - WindowsPATH="C:\Windows\system32;C:\Windows" ` - JAVA_HOME="${JAVA_HOME}" -ENV PATH="${WindowsPATH};${ProgramFiles}\PowerShell;${JAVA_HOME}\bin;C:\mingit\cmd" - -ARG user=jenkins - -ARG AGENT_FILENAME=agent.jar -ARG AGENT_HASH_FILENAME=$AGENT_FILENAME.sha1 - -RUN net accounts /maxpwage:unlimited ; ` - net user "$env:user" /add /expire:never /passwordreq:no ; ` - net localgroup Administrators /add $env:user ; ` - New-Item -ItemType Directory -Path C:/ProgramData/Jenkins | Out-Null - -ARG AGENT_ROOT=C:/Users/$user -ARG AGENT_WORKDIR=${AGENT_ROOT}/Work - -ENV AGENT_WORKDIR=${AGENT_WORKDIR} - -# Get the Agent from the Jenkins Artifacts Repository -ARG VERSION=4.13 -LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" -RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` - Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar' -f $env:VERSION) -OutFile $(Join-Path C:/ProgramData/Jenkins $env:AGENT_FILENAME) -UseBasicParsing ; ` - Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar.sha1' -f $env:VERSION) -OutFile (Join-Path C:/ProgramData/Jenkins $env:AGENT_HASH_FILENAME) -UseBasicParsing ; ` - if ((Get-FileHash (Join-Path C:/ProgramData/Jenkins $env:AGENT_FILENAME) -Algorithm SHA1).Hash -ne (Get-Content (Join-Path C:/ProgramData/Jenkins $env:AGENT_HASH_FILENAME))) {exit 1} ; ` - Remove-Item -Force (Join-Path C:/ProgramData/Jenkins $env:AGENT_HASH_FILENAME) - -USER $user - -RUN New-Item -Type Directory $('{0}/.jenkins' -f $env:AGENT_ROOT) | Out-Null ; ` - New-Item -Type Directory $env:AGENT_WORKDIR | Out-Null - -RUN git config --global core.longpaths true - -VOLUME ${AGENT_ROOT}/.jenkins -VOLUME ${AGENT_WORKDIR} -WORKDIR ${AGENT_ROOT} - -LABEL ` - org.opencontainers.image.vendor="Jenkins project" ` - org.opencontainers.image.title="Official Jenkins Agent Base Docker image" ` - org.opencontainers.image.description="This is a base image, which provides the Jenkins agent executable (agent.jar)" ` - org.opencontainers.image.version="${VERSION}" ` - org.opencontainers.image.url="https://www.jenkins.io/" ` - org.opencontainers.image.source="https://github.com/jenkinsci/docker-agent" ` - org.opencontainers.image.licenses="MIT" diff --git a/17/windows/windowsservercore-ltsc2019/Dockerfile b/17/windows/windowsservercore-ltsc2019/Dockerfile deleted file mode 100644 index 844f3f785..000000000 --- a/17/windows/windowsservercore-ltsc2019/Dockerfile +++ /dev/null @@ -1,93 +0,0 @@ -# escape=` - -# The MIT License -# -# Copyright (c) 2020, Alex Earl and other Jenkins Contributors -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -FROM eclipse-temurin:17.0.4.1_1-jdk-windowsservercore-1809 - -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] - -ARG GIT_VERSION=2.37.2 -ARG GIT_PATCH_VERSION=2 -RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` - $url = $('https://github.com/git-for-windows/git/releases/download/v{0}.windows.{1}/MinGit-{0}.{1}-64-bit.zip' -f $env:GIT_VERSION, $env:GIT_PATCH_VERSION) ; ` - Write-Host "Retrieving $url..." ; ` - Invoke-WebRequest $url -OutFile 'mingit.zip' -UseBasicParsing ; ` - Expand-Archive mingit.zip -DestinationPath c:\mingit ; ` - Remove-Item mingit.zip -Force - -ARG GIT_LFS_VERSION=3.1.4 -RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` - $url = $('https://github.com/git-lfs/git-lfs/releases/download/v{0}/git-lfs-windows-amd64-v{0}.zip' -f $env:GIT_LFS_VERSION) ; ` - Write-Host "Retrieving $url..." ; ` - Invoke-WebRequest $url -OutFile 'GitLfs.zip' -UseBasicParsing ; ` - Expand-Archive GitLfs.zip -DestinationPath c:\mingit\mingw64\bin ; ` - Remove-Item GitLfs.zip -Force ; ` - & C:\mingit\cmd\git.exe lfs install ; ` - $CurrentPath = (Get-Itemproperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path).Path ; ` - $NewPath = $CurrentPath + ';C:\mingit\cmd' ; ` - Set-ItemProperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path -Value $NewPath - -ARG user=jenkins - -ARG AGENT_FILENAME=agent.jar -ARG AGENT_HASH_FILENAME=$AGENT_FILENAME.sha1 - -RUN net accounts /maxpwage:unlimited ; ` - net user "$env:user" /add /expire:never /passwordreq:no ; ` - net localgroup Administrators /add $env:user ; ` - Set-LocalUser -Name $env:user -PasswordNeverExpires 1; ` - New-Item -ItemType Directory -Path C:/ProgramData/Jenkins | Out-Null - -ARG AGENT_ROOT=C:/Users/$user -ARG AGENT_WORKDIR=${AGENT_ROOT}/Work - -ENV AGENT_WORKDIR=${AGENT_WORKDIR} - -# Get the Agent from the Jenkins Artifacts Repository -ARG VERSION=4.13 -LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" -RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` - Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar' -f $env:VERSION) -OutFile $(Join-Path C:/ProgramData/Jenkins $env:AGENT_FILENAME) -UseBasicParsing ; ` - Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar.sha1' -f $env:VERSION) -OutFile (Join-Path C:/ProgramData/Jenkins $env:AGENT_HASH_FILENAME) -UseBasicParsing ; ` - if ((Get-FileHash (Join-Path C:/ProgramData/Jenkins $env:AGENT_FILENAME) -Algorithm SHA1).Hash -ne (Get-Content (Join-Path C:/ProgramData/Jenkins $env:AGENT_HASH_FILENAME))) {exit 1} ; ` - Remove-Item -Force (Join-Path C:/ProgramData/Jenkins $env:AGENT_HASH_FILENAME) - -USER $user - -RUN New-Item -Type Directory $('{0}/.jenkins' -f $env:AGENT_ROOT) | Out-Null ; ` - New-Item -Type Directory $env:AGENT_WORKDIR | Out-Null - -RUN git config --global core.longpaths true - -VOLUME ${AGENT_ROOT}/.jenkins -VOLUME ${AGENT_WORKDIR} -WORKDIR ${AGENT_ROOT} - -LABEL ` - org.opencontainers.image.vendor="Jenkins project" ` - org.opencontainers.image.title="Official Jenkins Agent Base Docker image" ` - org.opencontainers.image.description="This is a base image, which provides the Jenkins agent executable (agent.jar)" ` - org.opencontainers.image.version="${VERSION}" ` - org.opencontainers.image.url="https://www.jenkins.io/" ` - org.opencontainers.image.source="https://github.com/jenkinsci/docker-agent" ` - org.opencontainers.image.licenses="MIT" diff --git a/Makefile b/Makefile index 718312f47..645afc404 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ check_image = make --silent list | grep -w '$(1)' >/dev/null 2>&1 || { echo "Err bake_base_cli := docker buildx bake -f docker-bake.hcl --load .PHONY: build -.PHONY: test test-alpine test-archlinux test-debian test-jdk11 test-jdk11-alpine +.PHONY: test test-alpine test-archlinux test-debian check-reqs: ## Build requirements diff --git a/README.md b/README.md index f2c1982c4..0bbfa5357 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ after setting **Remote root directory** to `/home/jenkins/agent`. or if using Windows Containers ```powershell -docker run -i --rm --name agent --init jenkins/agent:jdk11-windowsservercore-ltsc2019 java -jar C:/ProgramData/Jenkins/agent.jar +docker run -i --rm --name agent --init jenkins/agent:jdk8-windowsservercore-ltsc2019 java -jar C:/ProgramData/Jenkins/agent.jar ``` after setting **Remote root directory** to `C:\Users\jenkins\Agent`. @@ -54,7 +54,7 @@ docker run -i --rm --name agent1 --init -v agent1-workdir:/home/jenkins/agent je Call example for Windows Containers: ```powershell -docker run -i --rm --name agent1 --init -v agent1-workdir:C:/Users/jenkins/Work jenkins/agent:jdk11-windowsservercore-ltsc2019 java -jar C:/ProgramData/Jenkins/agent.jar -workDir C:/Users/jenkins/Work +docker run -i --rm --name agent1 --init -v agent1-workdir:C:/Users/jenkins/Work jenkins/agent:jdk8-windowsservercore-ltsc2019 java -jar C:/ProgramData/Jenkins/agent.jar -workDir C:/Users/jenkins/Work ``` ## Configurations @@ -62,22 +62,14 @@ docker run -i --rm --name agent1 --init -v agent1-workdir:C:/Users/jenkins/Work The image has several supported configurations, which can be accessed via the following tags: * Linux Images: - * `latest` (`jdk11`, `bullseye-jdk11`, `latest-bullseye-jdk11`, `latest-jdk11`): Latest version with the newest remoting and Java 11 (based on `debian:bullseye-${builddate}`) * `latest-jdk8` (`jdk8`, `bullseye-jdk8`, `latest-bullseye-jdk8`): Latest version with the newest remoting (based on `debian:bullseye-${builddate}`) - * `alpine` (`alpine-jdk11`, `latest-alpine`, `latest-alpine-jdk11`): Small image based on Alpine Linux (based on `alpine:${version}`) * `alpine-jdk8` (`latest-alpine-jdk8`): Small image based on Alpine Linux (based on `alpine:${version}`) - * `archlinux` (`latest-archlinux`, `archlinux-jdk11`, `latest-archlinux-jdk11`): Image based on Arch Linux with JDK11 (based on `archlinux:latest`) - * `bullseye-jdk17` (`jdk17`, `latest-bullseye-jdk17`, `latest-jdk17`): JDK17 version with the newest remoting (based on `debian:bullseye-${builddate}`) From version 4.11.2, the alpine images are tagged using the alpine OS version as well (i.e. `alpine` ==> `alpine3.16`, `alpine-jdk8` ==> `alpine3.16-jdk8`). * Windows Images: * `jdk8-windowsservercore-1809`: Latest version with the newest remoting and Java 8 (based on `eclipse-temurin:8.xxx-jdk-windowsservercore-1809`) * `jdk8-nanoserver-1809`: Latest version with the newest remoting with Windows Nano Server and Java 8 (based on `eclipse-temurin:8.xxx-jdk-nanoserver-1809`) - * `jdk11-windowsservercore-1809`: Latest version with the newest remoting and Java 11 (based on `eclipse-temurin:11.xxx-jdk-windowsservercore-1809`) - * `jdk11-nanoserver-1809`: Latest version with the newest remoting with Windows Nano Server and Java 11 (based on `eclipse-temurin:11.xxx-jdk-nanoserver-1809`) - * `jdk17-windowsservercore-1809`: Latest version with the newest remoting and Java 17 (based on `eclipse-temurin:17.xxx-jdk-windowsservercore-1809`) - * `jdk17-nanoserver-1809`: Latest version with the newest remoting with Windows Nano Server and Java 17 (based on `eclipse-temurin:17.xxx-jdk-nanoserver-1809`) The file `docker-bake.hcl` defines all the configuration for Linux images and their associated tags. diff --git a/build-windows.yaml b/build-windows.yaml index e7fcb3c85..94421611a 100644 --- a/build-windows.yaml +++ b/build-windows.yaml @@ -6,28 +6,8 @@ services: context: ./8/windows/nanoserver-1809/ args: - VERSION=$REMOTING_VERSION - jdk11-nanoserver: - build: - context: ./11/windows/nanoserver-1809/ - args: - - VERSION=$REMOTING_VERSION - jdk17-nanoserver: - build: - context: ./17/windows/nanoserver-1809/ - args: - - VERSION=$REMOTING_VERSION jdk8-windowsservercore: build: context: ./8/windows/windowsservercore-ltsc2019/ args: - VERSION=$REMOTING_VERSION - jdk11-windowsservercore: - build: - context: ./11/windows/windowsservercore-ltsc2019/ - args: - - VERSION=$REMOTING_VERSION - jdk17-windowsservercore: - build: - context: ./17/windows/windowsservercore-ltsc2019/ - args: - - VERSION=$REMOTING_VERSION diff --git a/docker-bake.hcl b/docker-bake.hcl index 7b494ba3b..d72972775 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,32 +1,22 @@ group "linux" { targets = [ "alpine_jdk8", - "alpine_jdk11", - "alpine_jdk17", - "archlinux_jdk11", "debian_jdk8", - "debian_jdk11", - "debian_jdk17", ] } group "linux-arm64" { targets = [ - "debian_jdk11", - "debian_jdk17", ] } group "linux-arm32" { targets = [ - "debian_jdk11", - "debian_jdk17", ] } group "linux-s390x" { targets = [ - "debian_jdk11", ] } @@ -36,7 +26,6 @@ group "linux-ppc64le" { group "windows" { targets = [ - "windows_2019_jdk11", ] } @@ -68,23 +57,6 @@ variable "ALPINE_SHORT_TAG" { default = regex_replace(ALPINE_FULL_TAG, "\\.\\d+$", "") } -target "archlinux_jdk11" { - dockerfile = "11/archlinux/Dockerfile" - context = "." - args = { - VERSION = REMOTING_VERSION - } - tags = [ - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-archlinux": "", - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-archlinux-jdk11" : "", - "${REGISTRY}/${JENKINS_REPO}:archlinux", - "${REGISTRY}/${JENKINS_REPO}:latest-archlinux", - "${REGISTRY}/${JENKINS_REPO}:archlinux-jdk11", - "${REGISTRY}/${JENKINS_REPO}:latest-archlinux-jdk11", - ] - platforms = ["linux/amd64"] -} - target "alpine_jdk8" { dockerfile = "8/alpine/Dockerfile" context = "." @@ -103,48 +75,6 @@ target "alpine_jdk8" { platforms = ["linux/amd64"] } -target "alpine_jdk11" { - dockerfile = "11/alpine/Dockerfile" - context = "." - args = { - ALPINE_TAG = ALPINE_FULL_TAG - VERSION = REMOTING_VERSION - } - tags = [ - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine": "", - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine${ALPINE_SHORT_TAG}": "", - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine-jdk11": "", - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine${ALPINE_SHORT_TAG}-jdk11": "", - "${REGISTRY}/${JENKINS_REPO}:alpine", - "${REGISTRY}/${JENKINS_REPO}:alpine${ALPINE_SHORT_TAG}", - "${REGISTRY}/${JENKINS_REPO}:alpine-jdk11", - "${REGISTRY}/${JENKINS_REPO}:alpine${ALPINE_SHORT_TAG}-jdk11", - "${REGISTRY}/${JENKINS_REPO}:latest-alpine", - "${REGISTRY}/${JENKINS_REPO}:latest-alpine${ALPINE_SHORT_TAG}", - "${REGISTRY}/${JENKINS_REPO}:latest-alpine-jdk11", - "${REGISTRY}/${JENKINS_REPO}:latest-alpine${ALPINE_SHORT_TAG}-jdk11", - ] - platforms = ["linux/amd64"] -} - -target "alpine_jdk17" { - dockerfile = "17/alpine/Dockerfile" - context = "." - args = { - ALPINE_TAG = ALPINE_FULL_TAG - VERSION = REMOTING_VERSION - } - tags = [ - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine-jdk17": "", - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-alpine${ALPINE_SHORT_TAG}-jdk17": "", - "${REGISTRY}/${JENKINS_REPO}:alpine-jdk17", - "${REGISTRY}/${JENKINS_REPO}:alpine${ALPINE_SHORT_TAG}-jdk17", - "${REGISTRY}/${JENKINS_REPO}:latest-alpine-jdk17", - "${REGISTRY}/${JENKINS_REPO}:latest-alpine${ALPINE_SHORT_TAG}-jdk17", - ] - platforms = ["linux/amd64"] -} - target "debian_jdk8" { dockerfile = "8/bullseye/Dockerfile" context = "." @@ -160,37 +90,3 @@ target "debian_jdk8" { ] platforms = ["linux/amd64"] } - -target "debian_jdk11" { - dockerfile = "11/bullseye/Dockerfile" - context = "." - args = { - VERSION = REMOTING_VERSION - } - tags = [ - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}": "", - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-jdk11": "", - "${REGISTRY}/${JENKINS_REPO}:bullseye-jdk11", - "${REGISTRY}/${JENKINS_REPO}:jdk11", - "${REGISTRY}/${JENKINS_REPO}:latest", - "${REGISTRY}/${JENKINS_REPO}:latest-bullseye-jdk11", - "${REGISTRY}/${JENKINS_REPO}:latest-jdk11", - ] - platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7", "linux/s390x"] -} - -target "debian_jdk17" { - dockerfile = "17/bullseye/Dockerfile" - context = "." - args = { - VERSION = REMOTING_VERSION - } - tags = [ - equal(ON_TAG, "true") ? "${REGISTRY}/${JENKINS_REPO}:${REMOTING_VERSION}-${BUILD_NUMBER}-jdk17": "", - "${REGISTRY}/${JENKINS_REPO}:bullseye-jdk17", - "${REGISTRY}/${JENKINS_REPO}:jdk17", - "${REGISTRY}/${JENKINS_REPO}:latest-bullseye-jdk17", - "${REGISTRY}/${JENKINS_REPO}:latest-jdk17", - ] - platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7"] -} diff --git a/tests/agent.Tests.ps1 b/tests/agent.Tests.ps1 index 0eea5c502..0ec7e7f7f 100644 --- a/tests/agent.Tests.ps1 +++ b/tests/agent.Tests.ps1 @@ -23,13 +23,6 @@ if($global:FLAVOR -match "nanoserver-(?\d*)") { $global:SHELL = "pwsh.exe" } -if($global:JDK -eq "11") { - $global:AGENT_IMAGE += ":jdk11" - $global:AGENT_CONTAINER += "-jdk11" -} else { - $global:AGENT_IMAGE += ":latest" -} - Cleanup($global:AGENT_CONTAINER) Describe "[$global:JDK $global:FLAVOR] build image" { diff --git a/tests/tests.bats b/tests/tests.bats index bd795a08d..c772aee54 100755 --- a/tests/tests.bats +++ b/tests/tests.bats @@ -4,7 +4,7 @@ load test_helpers load 'test_helper/bats-support/load' # this is required by bats-assert! load 'test_helper/bats-assert/load' -IMAGE=${IMAGE:-debian_jdk11} +IMAGE=${IMAGE:-debian_jdk8} SUT_IMAGE=$(get_sut_image) ARCH=${ARCH:-x86_64} From e8df626377914d66d29387bd55628213e1faf1f6 Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Fri, 7 Oct 2022 11:18:36 -0600 Subject: [PATCH 2/8] Drop PowerPC 64 support (ppc64le) (#293) IBM no longer provides the PowerPC agents that we use to test and verify PowerPC support. Can't support an architecture that we can't test. (cherry picked from commit 702b4b37ad9078aaaa8d2d472f4e0c8c2f81563f) --- Makefile | 2 +- docker-bake.hcl | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 645afc404..63bcae62d 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ export DOCKER_CLI_EXPERIMENTAL=enabled export BUILDKIT_PROGRESS=plain current_arch := $(shell uname -m) -export ARCH ?= $(shell case $(current_arch) in (x86_64) echo "amd64" ;; (i386) echo "386";; (aarch64|arm64) echo "arm64" ;; (armv6*) echo "arm/v6";; (armv7*) echo "arm/v7";; (ppc64*|s390*|riscv*) echo $(current_arch);; (*) echo "UNKNOWN-CPU";; esac) +export ARCH ?= $(shell case $(current_arch) in (x86_64) echo "amd64" ;; (i386) echo "386";; (aarch64|arm64) echo "arm64" ;; (armv6*) echo "arm/v6";; (armv7*) echo "arm/v7";; (s390*|riscv*) echo $(current_arch);; (*) echo "UNKNOWN-CPU";; esac) IMAGE_NAME:=jenkins4eval/agent IMAGE_NAME_AGENT:=jenkins4eval/slave diff --git a/docker-bake.hcl b/docker-bake.hcl index d72972775..b0678d237 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -20,10 +20,6 @@ group "linux-s390x" { ] } -group "linux-ppc64le" { - targets = [] -} - group "windows" { targets = [ ] From ddb34cd2ee050266792f6ebf5b73c5750d3d4377 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Sat, 22 Oct 2022 10:48:34 +0200 Subject: [PATCH 3/8] Bump debian to bullseye-20221004 in /8/bullseye Signed-off-by: Damien Duportal --- 8/bullseye/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/8/bullseye/Dockerfile b/8/bullseye/Dockerfile index 9bff231ba..cc38907a6 100644 --- a/8/bullseye/Dockerfile +++ b/8/bullseye/Dockerfile @@ -22,7 +22,7 @@ FROM eclipse-temurin:8u342-b07-jdk-focal AS jre-build -FROM debian:bullseye-20220912 +FROM debian:bullseye-20221004 ARG VERSION=4.13 ARG user=jenkins From d0dc16b9c73ce0d75585340db705cbf4c9fbe51f Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Sat, 22 Oct 2022 09:09:13 +0200 Subject: [PATCH 4/8] chore(pipeline) only deploy when building a tag with a '-jdk8' suffix (to avoid overriding 'latest'-like docker tags) Signed-off-by: Damien Duportal --- Jenkinsfile | 143 +++++++++++++++++++++++++++------------------------- 1 file changed, 75 insertions(+), 68 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8bba513df..f65bf9bc0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,15 +1,11 @@ pipeline { agent none - options { + options { buildDiscarder(logRotator(daysToKeepStr: '10')) timestamps() } - triggers { - pollSCM('H * * * *') - } - stages { stage('Build') { parallel { @@ -23,39 +19,47 @@ pipeline { environment { DOCKERHUB_ORGANISATION = "${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}" } - steps { - powershell '& ./build.ps1 test' - script { - def branchName = "${env.BRANCH_NAME}" - if (branchName ==~ 'master') { - // publish the images to Dockerhub - infra.withDockerCredentials { - powershell '& ./build.ps1 publish' + stages { + stage('Build and Test') { + // This stage is the "CI" and should be run on all code changes triggered by a code change + when { + not { buildingTag() } + } + steps { + powershell '& ./build.ps1 test' + } + post { + always { + junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/**/junit-results.xml') } } - - if(env.TAG_NAME != null) { - def tagItems = env.TAG_NAME.split('-') - if(tagItems.length == 2) { - def remotingVersion = tagItems[0] - def buildNumber = tagItems[1] - // we need to build and publish the tag version - infra.withDockerCredentials { - powershell "& ./build.ps1 -PushVersions -RemotingVersion $remotingVersion -BuildNumber $buildNumber -DisableEnvProps publish" + } + stage('Deploy to DockerHub') { + // This stage is the "CD" and should only be run when a tag triggered the build + when { + tag "*-jdk8" + } + steps { + script { + if(env.TAG_NAME != null) { + def tagItems = env.TAG_NAME.split('-') + if(tagItems.length == 2) { + def remotingVersion = tagItems[0] + def buildNumber = tagItems[1] + // This function is defined in the jenkins-infra/pipeline-library + infra.withDockerCredentials { + powershell "& ./build.ps1 -PushVersions -RemotingVersion $remotingVersion -BuildNumber $buildNumber -DisableEnvProps publish" + } + } } } } } } - post { - always { - junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/**/junit-results.xml') - } - } } stage('Linux') { agent { - label "docker&&linux" + label "docker && linux" } options { timeout(time: 30, unit: 'MINUTES') @@ -63,57 +67,60 @@ pipeline { environment { DOCKERHUB_ORGANISATION = "${infra.isTrusted() ? 'jenkins' : 'jenkins4eval'}" } - steps { - sh './build.sh' - sh './build.sh test' - script { - def branchName = "${env.BRANCH_NAME}" - if (branchName ==~ 'master') { - // publish the images to Dockerhub - infra.withDockerCredentials { - sh ''' - docker buildx create --use - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - ./build.sh publish - ''' - } - } else if (env.TAG_NAME == null) { - infra.withDockerCredentials { - sh ''' - docker buildx create --use - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - docker buildx bake --file docker-bake.hcl linux - ''' + stages { + stage('Prepare Docker') { + steps { + sh ''' + docker buildx create --use + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + ''' + } + } + stage('Build and Test') { + // This stage is the "CI" and should be run on all code changes triggered by a code change + when { + not { buildingTag() } + } + steps { + sh './build.sh' + sh './build.sh test' + // If the tests are passing for Linux AMD64, then we can build all the CPU architectures + sh 'docker buildx bake --file docker-bake.hcl linux' + } + post { + always { + junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/*.xml') } } - - if(env.TAG_NAME != null) { - def tagItems = env.TAG_NAME.split('-') - if(tagItems.length == 2) { - def remotingVersion = tagItems[0] - def buildNumber = tagItems[1] - // we need to build and publish the tag version - infra.withDockerCredentials { - sh """ - docker buildx create --use - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - ./build.sh -r $remotingVersion -b $buildNumber -d publish - """ + } + stage('Deploy to DockerHub') { + // This stage is the "CD" and should only be run when a tag triggered the build + when { + tag "*-jdk8" + } + steps { + script { + def tagItems = env.TAG_NAME.split('-') + if(tagItems.length == 2) { + def remotingVersion = tagItems[0] + def buildNumber = tagItems[1] + // This function is defined in the jenkins-infra/pipeline-library + infra.withDockerCredentials { + sh """ + docker buildx create --use + docker run --rm --privileged multiarch/qemu-user-static --reset -p yes + ./build.sh -r ${remotingVersion} -b ${buildNumber} -d publish + """ + } } } } } } - post { - always { - junit(allowEmptyResults: true, keepLongStdio: true, testResults: 'target/*.xml') - } - } } } } } - } // vim: ft=groovy From fed1d3cd07e9db29b9efa8280ad9ab49c9685a06 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Sat, 22 Oct 2022 10:52:41 +0200 Subject: [PATCH 5/8] bump JDK8 to 8u345-b01 Signed-off-by: Damien Duportal --- 8/alpine/Dockerfile | 2 +- 8/bullseye/Dockerfile | 3 ++- 8/windows/nanoserver-1809/Dockerfile | 3 +-- 8/windows/windowsservercore-ltsc2019/Dockerfile | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/8/alpine/Dockerfile b/8/alpine/Dockerfile index 114f48c2a..518f297ac 100644 --- a/8/alpine/Dockerfile +++ b/8/alpine/Dockerfile @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG JAVA_VERSION="8u342-b07" +ARG JAVA_VERSION="8u345-b01" FROM eclipse-temurin:${JAVA_VERSION}-jdk-alpine ARG VERSION=4.13 diff --git a/8/bullseye/Dockerfile b/8/bullseye/Dockerfile index cc38907a6..7cd9587e5 100644 --- a/8/bullseye/Dockerfile +++ b/8/bullseye/Dockerfile @@ -20,7 +20,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -FROM eclipse-temurin:8u342-b07-jdk-focal AS jre-build +ARG JAVA_VERSION="8u345-b01" +FROM eclipse-temurin:${JAVA_VERSION}-jdk-focal AS jre-build FROM debian:bullseye-20221004 diff --git a/8/windows/nanoserver-1809/Dockerfile b/8/windows/nanoserver-1809/Dockerfile index fb1a8a511..b10dbe595 100644 --- a/8/windows/nanoserver-1809/Dockerfile +++ b/8/windows/nanoserver-1809/Dockerfile @@ -21,7 +21,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -ARG JAVA_VERSION="8u332-b09" +ARG JAVA_VERSION="8u345-b01" FROM eclipse-temurin:${JAVA_VERSION}-jdk-windowsservercore-1809 AS core # If you pass in a POWERSHELL_VERSION, make sure it ends with a hyphen, leaving it empty will @@ -29,7 +29,6 @@ FROM eclipse-temurin:${JAVA_VERSION}-jdk-windowsservercore-1809 AS core ARG POWERSHELL_VERSION= FROM mcr.microsoft.com/powershell:${POWERSHELL_VERSION}nanoserver-1809 -ARG JAVA_VERSION ARG JAVA_HOME="C:\openjdk-8" # The nanoserver image is nice and small, but we need a couple of things to get SSH working diff --git a/8/windows/windowsservercore-ltsc2019/Dockerfile b/8/windows/windowsservercore-ltsc2019/Dockerfile index deb523486..674d9d051 100644 --- a/8/windows/windowsservercore-ltsc2019/Dockerfile +++ b/8/windows/windowsservercore-ltsc2019/Dockerfile @@ -22,7 +22,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. -FROM eclipse-temurin:8u332-b09-jdk-windowsservercore-1809 +ARG JAVA_VERSION="8u345-b01" +FROM eclipse-temurin:${JAVA_VERSION}-jdk-windowsservercore-1809 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] From 158e58d768c47199ccaa91dd8a6310d392f60893 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Sat, 22 Oct 2022 10:55:13 +0200 Subject: [PATCH 6/8] chore: bump bats test tooling to their latest versions (1.8.2 for bats) Signed-off-by: Damien Duportal --- Makefile | 2 +- tests/test_helper/bats-assert | 2 +- tests/test_helper/bats-support | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 63bcae62d..3015edd98 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ list: check-reqs bats: git clone https://github.com/bats-core/bats-core bats ;\ cd bats ;\ - git checkout v1.4.1 + git checkout v1.8.2 prepare-test: bats check-reqs git submodule update --init --recursive diff --git a/tests/test_helper/bats-assert b/tests/test_helper/bats-assert index 672ad1823..ffe84ea5d 160000 --- a/tests/test_helper/bats-assert +++ b/tests/test_helper/bats-assert @@ -1 +1 @@ -Subproject commit 672ad1823a4d2f0c475fdbec0c4497498eec5f41 +Subproject commit ffe84ea5dd43b568851549b3e241db150c12929c diff --git a/tests/test_helper/bats-support b/tests/test_helper/bats-support index d140a6504..3c8fadc50 160000 --- a/tests/test_helper/bats-support +++ b/tests/test_helper/bats-support @@ -1 +1 @@ -Subproject commit d140a65044b2d6810381935ae7f0c94c7023c8c3 +Subproject commit 3c8fadc5097c9acfc96d836dced2bb598e48b009 From 6f9d5964b00bb2cfe1ef8f8a1d673e972ca1bac9 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Sat, 22 Oct 2022 16:30:40 +0200 Subject: [PATCH 7/8] feat(remoting) bump to 3028.va_a_436db_35078 Signed-off-by: Damien Duportal --- 8/alpine/Dockerfile | 2 +- 8/bullseye/Dockerfile | 4 ++-- 8/windows/nanoserver-1809/Dockerfile | 2 +- 8/windows/windowsservercore-ltsc2019/Dockerfile | 2 +- build.ps1 | 4 ++-- build.sh | 2 +- docker-bake.hcl | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/8/alpine/Dockerfile b/8/alpine/Dockerfile index 518f297ac..4cd633f34 100644 --- a/8/alpine/Dockerfile +++ b/8/alpine/Dockerfile @@ -23,7 +23,7 @@ ARG JAVA_VERSION="8u345-b01" FROM eclipse-temurin:${JAVA_VERSION}-jdk-alpine -ARG VERSION=4.13 +ARG VERSION=3028.va_a_436db_35078 ARG user=jenkins ARG group=jenkins ARG uid=1000 diff --git a/8/bullseye/Dockerfile b/8/bullseye/Dockerfile index 7cd9587e5..91b603672 100644 --- a/8/bullseye/Dockerfile +++ b/8/bullseye/Dockerfile @@ -25,7 +25,7 @@ FROM eclipse-temurin:${JAVA_VERSION}-jdk-focal AS jre-build FROM debian:bullseye-20221004 -ARG VERSION=4.13 +ARG VERSION=3028.va_a_436db_35078 ARG user=jenkins ARG group=jenkins ARG uid=1000 @@ -42,7 +42,7 @@ RUN apt-get update \ git-lfs \ curl \ fontconfig \ - && curl --create-dirs -fsSLo /usr/share/jenkins/agent.jar https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar \ + && curl --create-dirs -fsSLo /usr/share/jenkins/agent.jar "https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar" \ && chmod 755 /usr/share/jenkins \ && chmod 644 /usr/share/jenkins/agent.jar \ && ln -sf /usr/share/jenkins/agent.jar /usr/share/jenkins/slave.jar \ diff --git a/8/windows/nanoserver-1809/Dockerfile b/8/windows/nanoserver-1809/Dockerfile index b10dbe595..13ce41701 100644 --- a/8/windows/nanoserver-1809/Dockerfile +++ b/8/windows/nanoserver-1809/Dockerfile @@ -78,7 +78,7 @@ ARG AGENT_WORKDIR=${AGENT_ROOT}/Work ENV AGENT_WORKDIR=${AGENT_WORKDIR} # Get the Agent from the Jenkins Artifacts Repository -ARG VERSION=4.13 +ARG VERSION=3028.va_a_436db_35078 LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" RUN echo $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar' -f $env:VERSION) RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` diff --git a/8/windows/windowsservercore-ltsc2019/Dockerfile b/8/windows/windowsservercore-ltsc2019/Dockerfile index 674d9d051..8d66e2976 100644 --- a/8/windows/windowsservercore-ltsc2019/Dockerfile +++ b/8/windows/windowsservercore-ltsc2019/Dockerfile @@ -65,7 +65,7 @@ ARG AGENT_WORKDIR=${AGENT_ROOT}/Work ENV AGENT_WORKDIR=${AGENT_WORKDIR} # Get the Agent from the Jenkins Artifacts Repository -ARG VERSION=4.13 +ARG VERSION=3028.va_a_436db_35078 LABEL Description="This is a base image, which provides the Jenkins agent executable (agent.jar)" Vendor="Jenkins project" Version="${VERSION}" RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 ; ` Invoke-WebRequest $('https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/{0}/remoting-{0}.jar' -f $env:VERSION) -OutFile $(Join-Path C:/ProgramData/Jenkins $env:AGENT_FILENAME) -UseBasicParsing ; ` diff --git a/build.ps1 b/build.ps1 index 379daa617..6e6bc53c3 100644 --- a/build.ps1 +++ b/build.ps1 @@ -4,8 +4,8 @@ Param( [String] $Target = "build", [String] $AdditionalArgs = '', [String] $Build = '', - [String] $RemotingVersion = '4.6', - [String] $BuildNumber = "6", + [String] $RemotingVersion = '3028.va_a_436db_35078', + [String] $BuildNumber = '1', [switch] $PushVersions = $false, [switch] $DisableEnvProps = $false ) diff --git a/build.sh b/build.sh index 69fec3d9b..4d824612c 100755 --- a/build.sh +++ b/build.sh @@ -7,7 +7,7 @@ OPTIND=1 target="build" build_number="" -remoting_version="4.3" +remoting_version="3028.va_a_436db_35078" disable_env_props=0 exit_result=0 diff --git a/docker-bake.hcl b/docker-bake.hcl index b0678d237..2bb2f98d9 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -26,7 +26,7 @@ group "windows" { } variable "REMOTING_VERSION" { - default = "4.3" + default = "3028.va_a_436db_35078" } variable "REGISTRY" { @@ -38,7 +38,7 @@ variable "JENKINS_REPO" { } variable "BUILD_NUMBER" { - default = "6" + default = "1" } variable "ON_TAG" { From c552c0ccdcc286411da38469f4e1de93470ab0f0 Mon Sep 17 00:00:00 2001 From: Damien Duportal Date: Thu, 27 Oct 2022 14:57:15 +0200 Subject: [PATCH 8/8] code review Signed-off-by: Damien Duportal --- Jenkinsfile | 3 ++- tests/tests.bats | 7 ------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f65bf9bc0..a5549319d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -43,7 +43,8 @@ pipeline { script { if(env.TAG_NAME != null) { def tagItems = env.TAG_NAME.split('-') - if(tagItems.length == 2) { + // JDK8 builds only: the 3rd element is the '-jdk8' suffix + if(tagItems.length == 3) { def remotingVersion = tagItems[0] def buildNumber = tagItems[1] // This function is defined in the jenkins-infra/pipeline-library diff --git a/tests/tests.bats b/tests/tests.bats index c772aee54..607bad812 100755 --- a/tests/tests.bats +++ b/tests/tests.bats @@ -102,13 +102,6 @@ docker buildx bake \ is_agent_container_running "${cid}" - # TODO https://github.com/jenkinsci/remoting/pull/481 - # Current line is: 'A terminally deprecated method in java.lang.System has been called' - if [[ $IMAGE != *"17"* ]]; then - run docker exec "${cid}" sh -c "java -cp /usr/share/jenkins/agent.jar hudson.remoting.jnlp.Main -version" - assert_line --index 0 "${TEST_VERSION}" - fi - run docker exec "${cid}" sh -c "id -u -n ${TEST_USER}" assert_line --index 0 "${TEST_USER}"