From dba1f72f60c650c703c27dea1dcb1fefa7dd82c0 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 12 Nov 2022 13:31:10 +0000 Subject: [PATCH 1/4] chore: changed lines [24 32] of file "/tmp/updatecli/github/jenkinsci/d... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ocker-agent/17/windows/nanoserver-1809/Dockerfile" Made with ❤️️ by updatecli --- 17/windows/nanoserver-1809/Dockerfile | 216 +++++++++++++------------- 1 file changed, 108 insertions(+), 108 deletions(-) diff --git a/17/windows/nanoserver-1809/Dockerfile b/17/windows/nanoserver-1809/Dockerfile index 3625d8adf..487dda4f6 100644 --- a/17/windows/nanoserver-1809/Dockerfile +++ b/17/windows/nanoserver-1809/Dockerfile @@ -1,108 +1,108 @@ -# 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=3071.v7e9b_0dc08466 -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" +# 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.5_8 +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=17.0.5_8 +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=3071.v7e9b_0dc08466 +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" From adf24b8c75ad42900a30c55e6255367e5a1d6323 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 12 Nov 2022 13:31:10 +0000 Subject: [PATCH 2/4] chore: changed lines [24 32] of file "/tmp/updatecli/github/jenkinsci/d... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ocker-agent/17/windows/nanoserver-1809/Dockerfile" Made with ❤️️ by updatecli --- 17/bullseye/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/17/bullseye/Dockerfile b/17/bullseye/Dockerfile index c842772b4..1d249aeb3 100644 --- a/17/bullseye/Dockerfile +++ b/17/bullseye/Dockerfile @@ -25,11 +25,11 @@ # Cannot get jlink to properly work, in the v7 environment. # The jmods error above gets generated each time. # Better to have a larger image than incorrect java binaries in 32bit arm. -ARG JAVA_VERSION="17.0.4.1_1" +ARG JAVA_VERSION=17.0.5_8 FROM eclipse-temurin:${JAVA_VERSION}-jdk-focal AS arm32-jre-build RUN cp -r /opt/java/openjdk /javaruntime -ARG JAVA_VERSION="17.0.4.1_1" +ARG JAVA_VERSION=17.0.5_8 FROM eclipse-temurin:${JAVA_VERSION}-jdk-focal AS jre-build # Generate smaller java runtime without unneeded files From f42c3150059e0f74729407a83ecfcf6bd54ebb10 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 12 Nov 2022 13:31:11 +0000 Subject: [PATCH 3/4] chore: changed lines [24 32] of file "/tmp/updatecli/github/jenkinsci/d... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ocker-agent/17/windows/nanoserver-1809/Dockerfile" Made with ❤️️ by updatecli --- 17/alpine/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/17/alpine/Dockerfile b/17/alpine/Dockerfile index e0f41eb96..0e8563d6c 100644 --- a/17/alpine/Dockerfile +++ b/17/alpine/Dockerfile @@ -19,7 +19,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="17.0.4.1_1" +ARG JAVA_VERSION=17.0.5_8 FROM eclipse-temurin:${JAVA_VERSION}-jdk-alpine ARG VERSION=3071.v7e9b_0dc08466 From f9030505529f701e2079ef1bccbb83223bb0f2e6 Mon Sep 17 00:00:00 2001 From: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 12 Nov 2022 13:31:12 +0000 Subject: [PATCH 4/4] chore: changed lines [24 32] of file "/tmp/updatecli/github/jenkinsci/d... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... ocker-agent/17/windows/nanoserver-1809/Dockerfile" Made with ❤️️ by updatecli --- .../windowsservercore-ltsc2019/Dockerfile | 188 +++++++++--------- 1 file changed, 94 insertions(+), 94 deletions(-) diff --git a/17/windows/windowsservercore-ltsc2019/Dockerfile b/17/windows/windowsservercore-ltsc2019/Dockerfile index 8487c4fe2..e30051d70 100644 --- a/17/windows/windowsservercore-ltsc2019/Dockerfile +++ b/17/windows/windowsservercore-ltsc2019/Dockerfile @@ -1,94 +1,94 @@ -# 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 - -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=3071.v7e9b_0dc08466 -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" +# 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.5_8 +FROM eclipse-temurin:${JAVA_VERSION}-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=3071.v7e9b_0dc08466 +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"