diff --git a/checks/windows-dotnet/docker-compose.yml b/checks/windows-dotnet/docker-compose.yml index e8ef5e625..46669df02 100644 --- a/checks/windows-dotnet/docker-compose.yml +++ b/checks/windows-dotnet/docker-compose.yml @@ -1,7 +1,7 @@ version: '2' services: teamcity-server: - image: teamcity-server:local-nanoserver-2004 + image: teamcity-server:local-nanoserver-2022 ports: - "8112:8111" diff --git a/checks/windows-jetbrains/docker-compose.yml b/checks/windows-jetbrains/docker-compose.yml index 41c21da74..08f58172f 100644 --- a/checks/windows-jetbrains/docker-compose.yml +++ b/checks/windows-jetbrains/docker-compose.yml @@ -1,21 +1,21 @@ version: '2' services: teamcity-server: - image: registry.jetbrains.team/teamcity/teamcity-server:EAP-nanoserver-2004 + image: registry.jetbrains.team/teamcity/teamcity-server:EAP-nanoserver-2022 ports: - "8112:8111" teamcity-minimal-agent: - image: registry.jetbrains.team/teamcity/teamcity-minimal-agent:EAP-nanoserver-2004 + image: registry.jetbrains.team/teamcity/teamcity-minimal-agent:EAP-nanoserver-2022 environment: - SERVER_URL=teamcity-server:8111 teamcity-agent: - image: registry.jetbrains.team/teamcity/teamcity-agent:EAP-nanoserver-2004 + image: registry.jetbrains.team/teamcity/teamcity-agent:EAP-nanoserver-2022 environment: - SERVER_URL=teamcity-server:8111 teamcity-core-agent: - image: registry.jetbrains.team/teamcity/teamcity-agent:EAP-windowsservercore-2004 + image: registry.jetbrains.team/teamcity/teamcity-agent:EAP-windowsservercore-2022 environment: - SERVER_URL=teamcity-server:8111 \ No newline at end of file diff --git a/configs/windows/Agent/nanoserver/2004/NanoServer1809.Dockerfile.config b/configs/windows/Agent/nanoserver/2022/NanoServer2022.Dockerfile.config similarity index 61% rename from configs/windows/Agent/nanoserver/2004/NanoServer1809.Dockerfile.config rename to configs/windows/Agent/nanoserver/2022/NanoServer2022.Dockerfile.config index 245e614d7..36cfb8fe2 100644 --- a/configs/windows/Agent/nanoserver/2004/NanoServer1809.Dockerfile.config +++ b/configs/windows/Agent/nanoserver/2022/NanoServer2022.Dockerfile.config @@ -1,8 +1,8 @@ -windowsBuild=2004 +windowsBuild=2022 tag=nanoserver-${windowsBuild} repo=https://hub.docker.com/r/jetbrains/ # https://hub.docker.com/_/microsoft-powershell -powershellImage=mcr.microsoft.com/powershell:nanoserver-${windowsBuild} +powershellImage=mcr.microsoft.com/powershell:nanoserver-ltsc${windowsBuild} # https://hub.docker.com/_/microsoft-windows-nanoserver -nanoserverImage=mcr.microsoft.com/windows/nanoserver:${windowsBuild} +nanoserverImage=mcr.microsoft.com/windows/nanoserver:ltsc${windowsBuild} teamcityWindowsservercoreImage=teamcity-agent:${versionTag}-windowsservercore-${windowsBuild} \ No newline at end of file diff --git a/configs/windows/Agent/nanoserver/NanoServer1803.Dockerfile b/configs/windows/Agent/nanoserver/NanoServer1803.Dockerfile index 95e3091b5..7ee37bf09 100644 --- a/configs/windows/Agent/nanoserver/NanoServer1803.Dockerfile +++ b/configs/windows/Agent/nanoserver/NanoServer1803.Dockerfile @@ -52,7 +52,7 @@ VOLUME C:/BuildAgent/conf CMD ["pwsh", "./BuildAgent/run-agent.ps1"] # Configuration file for TeamCity agent -ENV CONFIG_FILE="C:/BuildAgent/conf/buildAgent.properties" \ +ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \ # Java home directory JAVA_HOME="C:\Program Files\Java\OpenJDK" \ # Opt out of the telemetry feature diff --git a/configs/windows/Agent/nanoserver/NanoServer1809.Dockerfile b/configs/windows/Agent/nanoserver/NanoServer1809.Dockerfile index c4673f2f3..13ba5787e 100644 --- a/configs/windows/Agent/nanoserver/NanoServer1809.Dockerfile +++ b/configs/windows/Agent/nanoserver/NanoServer1809.Dockerfile @@ -71,7 +71,7 @@ EXPOSE 9090 VOLUME C:/BuildAgent/conf # Configuration file for TeamCity agent -ENV CONFIG_FILE="C:/BuildAgent/conf/buildAgent.properties" \ +ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \ # Java home directory JAVA_HOME="C:\Program Files\Java\OpenJDK" \ # Opt out of the telemetry feature diff --git a/configs/windows/Agent/nanoserver/NanoServer2022.Dockerfile b/configs/windows/Agent/nanoserver/NanoServer2022.Dockerfile new file mode 100644 index 000000000..e7b5c015a --- /dev/null +++ b/configs/windows/Agent/nanoserver/NanoServer2022.Dockerfile @@ -0,0 +1,102 @@ +# The list of required arguments +# ARG nanoserverImage +# ARG powershellImage +# ARG teamcityWindowsservercoreImage + +# Id teamcity-agent +# Tag ${versionTag}-${tag} +# Tag ${latestTag} +# Tag ${versionTag} +# Platform ${windowsPlatform} +# Repo ${repo} +# Weight 2 + +## ${agentCommentHeader} + +# @AddToolToDoc [${jdkWindowsComponentName}](${jdkWindowsComponent}) +# @AddToolToDoc ${powerShellComponentName} +# @AddToolToDoc [${gitWindowsComponentName}](${gitWindowsComponent}) +# @AddToolToDoc [${dotnetWindowsComponentName}](${dotnetWindowsComponent}) + +# Based on ${powershellImage} 3 +FROM ${powershellImage} AS dotnet + +# On some agents, Windows 2022 requires administrator permissions to modify "C:/" folder within ... +# ... PowerShell container. +USER ContainerAdministrator + +COPY scripts/*.cs /scripts/ +SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# Based on ${teamcityWindowsservercoreImage} +ARG teamcityWindowsservercoreImage +FROM ${teamcityWindowsservercoreImage} AS tools + +# Workaround for https://github.com/PowerShell/PowerShell-Docker/issues/164 +ARG nanoserverImage +# Based on ${nanoserverImage} 2 +FROM ${nanoserverImage} + +ENV ProgramFiles="C:\Program Files" \ + # set a fixed location for the Module analysis cache + PSModuleAnalysisCachePath="C:\Users\ContainerUser\AppData\Local\Microsoft\Windows\PowerShell\docker\ModuleAnalysisCache" \ + # Persist %PSCORE% ENV variable for user convenience + PSCORE="$ProgramFiles\PowerShell\pwsh.exe" + +# PowerShell +COPY --from=dotnet ["C:/Program Files/PowerShell", "C:/Program Files/PowerShell"] + +# In order to set system PATH, ContainerAdministrator must be used +USER ContainerAdministrator +RUN setx /M PATH "%PATH%;%ProgramFiles%\PowerShell" +USER ContainerUser + +# intialize powershell module cache +RUN pwsh -NoLogo -NoProfile -Command " \ + $stopTime = (get-date).AddMinutes(15); \ + $ErrorActionPreference = 'Stop' ; \ + $ProgressPreference = 'SilentlyContinue' ; \ + while(!(Test-Path -Path $env:PSModuleAnalysisCachePath)) { \ + Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \ + if((get-date) -gt $stopTime) { throw 'timout expired'} \ + Start-Sleep -Seconds 6 ; \ + }" + +# JDK +COPY --from=tools ["C:/Program Files/Java/OpenJDK", "C:/Program Files/Java/OpenJDK"] +# Git +COPY --from=tools ["C:/Program Files/Git", "C:/Program Files/Git"] +# .NET +COPY --from=tools ["C:/Program Files/dotnet", "C:/Program Files/dotnet"] +COPY --from=tools /BuildAgent /BuildAgent + +EXPOSE 9090 + +VOLUME C:/BuildAgent/conf + + # Configuration file for TeamCity agent +ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \ + # Java home directory + JAVA_HOME="C:\Program Files\Java\OpenJDK" \ + # Opt out of the telemetry feature + DOTNET_CLI_TELEMETRY_OPTOUT=true \ + # Disable first time experience + DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true \ + # Configure Kestrel web server to bind to port 80 when present + ASPNETCORE_URLS=http://+:80 \ + # Enable detection of running in a container + DOTNET_RUNNING_IN_CONTAINER=true \ + # Enable correct mode for dotnet watch (only mode supported in a container) + DOTNET_USE_POLLING_FILE_WATCHER=true \ + # Skip extraction of XML docs - generally not useful within an image/container - helps perfomance + NUGET_XMLDOC_MODE=skip + +# In order to set system PATH, ContainerAdministrator must be used +USER ContainerAdministrator +RUN setx /M PATH "%PATH%;%JAVA_HOME%\bin;C:\Program Files\Git\cmd;C:\Program Files\dotnet" +USER ContainerUser + +# Trigger first run experience by running arbitrary cmd to populate local package cache +RUN dotnet help + +CMD ["pwsh", "./BuildAgent/run-agent.ps1"] \ No newline at end of file diff --git a/configs/windows/Agent/nanoserver/NanoServer2022.Dockerignore b/configs/windows/Agent/nanoserver/NanoServer2022.Dockerignore new file mode 100644 index 000000000..6e126ca56 --- /dev/null +++ b/configs/windows/Agent/nanoserver/NanoServer2022.Dockerignore @@ -0,0 +1,3 @@ +TeamCity/webapps +TeamCity/devPackage +TeamCity/lib \ No newline at end of file diff --git a/configs/windows/Agent/windowsservercore/2004/WindowsServerCore1803.Dockerfile.config b/configs/windows/Agent/windowsservercore/2022/WindowsServerCore2022.Dockerfile.config similarity index 83% rename from configs/windows/Agent/windowsservercore/2004/WindowsServerCore1803.Dockerfile.config rename to configs/windows/Agent/windowsservercore/2022/WindowsServerCore2022.Dockerfile.config index 118559643..0b459fabc 100644 --- a/configs/windows/Agent/windowsservercore/2004/WindowsServerCore1803.Dockerfile.config +++ b/configs/windows/Agent/windowsservercore/2022/WindowsServerCore2022.Dockerfile.config @@ -1,6 +1,6 @@ -windowsBuild=2004 +windowsBuild=2022 tag=windowsservercore-${windowsBuild} repo=https://hub.docker.com/r/jetbrains/ # https://hub.docker.com/_/microsoft-dotnet-framework-sdk/ -windowsservercoreImage=mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-${windowsBuild} +windowsservercoreImage=mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc${windowsBuild} teamcityMinimalAgentImage=teamcity-minimal-agent:${versionTag}-nanoserver-${windowsBuild} \ No newline at end of file diff --git a/configs/windows/Agent/windowsservercore/WindowsServerCore1803.Dockerfile b/configs/windows/Agent/windowsservercore/WindowsServerCore1803.Dockerfile index f0166efd5..e51e0e5dd 100644 --- a/configs/windows/Agent/windowsservercore/WindowsServerCore1803.Dockerfile +++ b/configs/windows/Agent/windowsservercore/WindowsServerCore1803.Dockerfile @@ -51,7 +51,7 @@ RUN [Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11, tls' ; \ Add-Type -IgnoreWarnings -TypeDefinition "$code" -Language CSharp ; \ $downloadScript = [Scripts.Web]::DownloadFiles($Env:jdkWindowsComponent + '#MD5#' + $Env:jdkWindowsComponentMD5SUM, 'jdk.zip', $Env:gitWindowsComponent + '#SHA256#' + $Env:gitWindowsComponentSHA256, 'git.zip', $Env:mercurialWindowsComponent, 'hg.msi', $Env:dotnetWindowsComponent + '#SHA512#' + $Env:dotnetWindowsComponentSHA512, 'dotnet.zip') ; \ Remove-Item -Force -Recurse $Env:ProgramFiles\dotnet; \ -# .NET 6.0 +# .NET 6.0, .NET Framework 4 is inherited from base image Expand-Archive dotnet.zip -Force -DestinationPath $Env:ProgramFiles\dotnet; \ Remove-Item -Force dotnet.zip; \ Get-ChildItem -Path $Env:ProgramFiles\dotnet -Include *.lzma -File -Recurse | foreach { $_.Delete()}; \ @@ -82,7 +82,7 @@ VOLUME C:/BuildAgent/conf CMD ["pwsh", "./BuildAgent/run-agent.ps1"] # Configuration file for TeamCity agent -ENV CONFIG_FILE="C:/BuildAgent/conf/buildAgent.properties" \ +ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \ # Java home directory JAVA_HOME="C:\Program Files\Java\OpenJDK" \ # Opt out of the telemetry feature diff --git a/configs/windows/Agent/windowsservercore/WindowsServerCore2022.Dockerfile b/configs/windows/Agent/windowsservercore/WindowsServerCore2022.Dockerfile new file mode 100644 index 000000000..91ce1185e --- /dev/null +++ b/configs/windows/Agent/windowsservercore/WindowsServerCore2022.Dockerfile @@ -0,0 +1,107 @@ +# The list of required arguments +# ARG windowsservercoreImage +# ARG dotnetWindowsComponent +# ARG dotnetWindowsComponentSHA512 +# ARG jdkWindowsComponent +# ARG jdkWindowsComponentMD5SUM +# ARG gitWindowsComponent +# ARG gitWindowsComponentSHA256 +# ARG mercurialWindowsComponentName +# ARG teamcityMinimalAgentImage + +# Id teamcity-agent +# Tag ${versionTag}-${tag} +# Tag ${versionTag}-windowsservercore +# Tag ${latestTag}-windowsservercore +# Platform ${windowsPlatform} +# Repo ${repo} +# Weight 16 +# Requires teamcity.agent.jvm.os.name contains Windows 10 + +## ${agentCommentHeader} + +# @AddToolToDoc [${jdkWindowsComponentName}](${jdkWindowsComponent}) +# @AddToolToDoc [${gitWindowsComponentName}](${gitWindowsComponent}) +# @AddToolToDoc ${powerShellComponentName} +# @AddToolToDoc [${mercurialWindowsComponentName}](${mercurialWindowsComponent}) +# @AddToolToDoc [${dotnetWindowsComponentName}](${dotnetWindowsComponent}) + +# Based on ${teamcityMinimalAgentImage} +FROM ${teamcityMinimalAgentImage} AS buildagent + +# Based on ${windowsservercoreImage} 12 +ARG windowsservercoreImage +FROM ${windowsservercoreImage} + +# On some agents, Windows 2022 requires administrator permissions to modify "C:/" folder within ... +# ... PowerShell container. +USER ContainerAdministrator + +COPY scripts/*.cs /scripts/ + +# PowerShell +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +ARG dotnetWindowsComponent +ARG dotnetWindowsComponentSHA512 +ARG jdkWindowsComponent +ARG jdkWindowsComponentMD5SUM +ARG gitWindowsComponent +ARG gitWindowsComponentSHA256 +ARG mercurialWindowsComponent + +RUN [Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11, tls' ; \ + $code = Get-Content -Path "scripts/Web.cs" -Raw ; \ + Add-Type -IgnoreWarnings -TypeDefinition "$code" -Language CSharp ; \ + $downloadScript = [Scripts.Web]::DownloadFiles($Env:jdkWindowsComponent + '#MD5#' + $Env:jdkWindowsComponentMD5SUM, 'jdk.zip', $Env:gitWindowsComponent + '#SHA256#' + $Env:gitWindowsComponentSHA256, 'git.zip', $Env:mercurialWindowsComponent, 'hg.msi', $Env:dotnetWindowsComponent + '#SHA512#' + $Env:dotnetWindowsComponentSHA512, 'dotnet.zip') ; \ + Remove-Item -Force -Recurse $Env:ProgramFiles\dotnet; \ +# .NET 6.0, .NET Framework 4 is inherited from base image + Expand-Archive dotnet.zip -Force -DestinationPath $Env:ProgramFiles\dotnet; \ + Remove-Item -Force dotnet.zip; \ + Get-ChildItem -Path $Env:ProgramFiles\dotnet -Include *.lzma -File -Recurse | foreach { $_.Delete()}; \ +# JDK + Expand-Archive jdk.zip -DestinationPath $Env:ProgramFiles\Java ; \ + Get-ChildItem $Env:ProgramFiles\Java | Rename-Item -NewName "OpenJDK" ; \ + Remove-Item $Env:ProgramFiles\Java\OpenJDK\lib\src.zip -Force ; \ + Remove-Item -Force jdk.zip ; \ +# Git + $gitPath = $Env:ProgramFiles + '\Git'; \ + Expand-Archive git.zip -DestinationPath $gitPath ; \ + Remove-Item -Force git.zip ; \ + # avoid circular dependencies in gitconfig + $gitConfigFile = $gitPath + '\etc\gitconfig'; \ + $configContent = Get-Content $gitConfigFile; \ + $configContent = $configContent.Replace('path = C:/Program Files/Git/etc/gitconfig', ''); \ + Set-Content $gitConfigFile $configContent; \ +# Mercirual + Start-Process msiexec -Wait -ArgumentList /q, /i, hg.msi ; \ + Remove-Item -Force hg.msi + +COPY --from=buildagent /BuildAgent /BuildAgent + +EXPOSE 9090 + +VOLUME C:/BuildAgent/conf + +CMD ["pwsh", "./BuildAgent/run-agent.ps1"] + + # Configuration file for TeamCity agent +ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \ + # Java home directory + JAVA_HOME="C:\Program Files\Java\OpenJDK" \ + # Opt out of the telemetry feature + DOTNET_CLI_TELEMETRY_OPTOUT=true \ + # Disable first time experience + DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true \ + # Configure Kestrel web server to bind to port 80 when present + ASPNETCORE_URLS=http://+:80 \ + # Enable detection of running in a container + DOTNET_RUNNING_IN_CONTAINER=true \ + # Enable correct mode for dotnet watch (only mode supported in a container) + DOTNET_USE_POLLING_FILE_WATCHER=true \ + # Skip extraction of XML docs - generally not useful within an image/container - helps perfomance + NUGET_XMLDOC_MODE=skip + +USER ContainerAdministrator +RUN setx /M PATH ('{0};{1}\bin;C:\Program Files\Git\cmd;C:\Program Files\Mercurial' -f $env:PATH, $env:JAVA_HOME) +USER ContainerUser \ No newline at end of file diff --git a/configs/windows/Agent/windowsservercore/WindowsServerCore2022.Dockerignore b/configs/windows/Agent/windowsservercore/WindowsServerCore2022.Dockerignore new file mode 100644 index 000000000..6e126ca56 --- /dev/null +++ b/configs/windows/Agent/windowsservercore/WindowsServerCore2022.Dockerignore @@ -0,0 +1,3 @@ +TeamCity/webapps +TeamCity/devPackage +TeamCity/lib \ No newline at end of file diff --git a/configs/windows/MinimalAgent/nanoserver/2004/NanoServer1809.Dockerfile.config b/configs/windows/MinimalAgent/nanoserver/2022/NanoServer2022.Dockerfile.config similarity index 51% rename from configs/windows/MinimalAgent/nanoserver/2004/NanoServer1809.Dockerfile.config rename to configs/windows/MinimalAgent/nanoserver/2022/NanoServer2022.Dockerfile.config index 7c7bbcd5f..4cee49932 100644 --- a/configs/windows/MinimalAgent/nanoserver/2004/NanoServer1809.Dockerfile.config +++ b/configs/windows/MinimalAgent/nanoserver/2022/NanoServer2022.Dockerfile.config @@ -1,7 +1,7 @@ -windowsBuild=2004 +windowsBuild=2022 tag=nanoserver-${windowsBuild} repo=https://hub.docker.com/r/jetbrains/ # https://hub.docker.com/_/microsoft-powershell -powershellImage=mcr.microsoft.com/powershell:nanoserver-${windowsBuild} +powershellImage=mcr.microsoft.com/powershell:nanoserver-ltsc${windowsBuild} # https://hub.docker.com/_/microsoft-windows-nanoserver -nanoserverImage=mcr.microsoft.com/windows/nanoserver:${windowsBuild} \ No newline at end of file +nanoserverImage=mcr.microsoft.com/windows/nanoserver:ltsc${windowsBuild} \ No newline at end of file diff --git a/configs/windows/MinimalAgent/nanoserver/NanoServer2022.Dockerfile b/configs/windows/MinimalAgent/nanoserver/NanoServer2022.Dockerfile new file mode 100644 index 000000000..c6bd4018d --- /dev/null +++ b/configs/windows/MinimalAgent/nanoserver/NanoServer2022.Dockerfile @@ -0,0 +1,92 @@ +# The list of required arguments +# ARG jdkWindowsComponent +# ARG jdkWindowsComponentMD5SUM +# ARG nanoserverImage +# ARG powershellImage + +# Id teamcity-minimal-agent +# Tag ${versionTag}-${tag} +# Tag ${latestTag} +# Tag ${versionTag} +# Platform ${windowsPlatform} +# Repo ${repo} +# Weight 5 +# Requires teamcity.agent.jvm.os.name contains Windows 10 + +## ${agentCommentHeader} + +# @AddToolToDoc [${jdkWindowsComponentName}](${jdkWindowsComponent}) +# @AddToolToDoc ${powerShellComponentName} + +# Based on ${powershellImage} 3 +FROM ${powershellImage} AS base + +# On some agents, Windows 2022 requires administrator permissions to modify "C:/" folder within ... +# ... PowerShell container. +USER ContainerAdministrator + +COPY scripts/*.cs /scripts/ +SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# Prepare build agent distribution +COPY TeamCity/buildAgent C:/BuildAgent +COPY run-agent.ps1 /BuildAgent/run-agent.ps1 + +# JDK +ARG jdkWindowsComponent +ARG jdkWindowsComponentMD5SUM + +RUN [Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11, tls' ; \ + $code = Get-Content -Path "scripts/Web.cs" -Raw ; \ + Add-Type -IgnoreWarnings -TypeDefinition "$code" -Language CSharp ; \ + $downloadScript = [Scripts.Web]::DownloadFiles($Env:jdkWindowsComponent + '#MD5#' + $Env:jdkWindowsComponentMD5SUM, 'jdk.zip') ; \ + iex $downloadScript ; \ + Expand-Archive jdk.zip -DestinationPath $Env:ProgramFiles\Java ; \ + Get-ChildItem $Env:ProgramFiles\Java | Rename-Item -NewName "OpenJDK" ; \ + Remove-Item -Force jdk.zip ; \ + if (Test-Path '/BuildAgent/system/.teamcity-agent/unpacked-plugins.xml') { (Get-Content '/BuildAgent/system/.teamcity-agent/unpacked-plugins.xml').replace('/', '\\') | Set-Content '/BuildAgent/system/.teamcity-agent/unpacked-plugins.xml' } + +# Workaround for https://github.com/PowerShell/PowerShell-Docker/issues/164 +ARG nanoserverImage + +# Based on ${nanoserverImage} 2 +FROM ${nanoserverImage} + +ENV ProgramFiles="C:\Program Files" \ + # set a fixed location for the Module analysis cache + PSModuleAnalysisCachePath="C:\Users\ContainerUser\AppData\Local\Microsoft\Windows\PowerShell\docker\ModuleAnalysisCache" \ + # Persist %PSCORE% ENV variable for user convenience + PSCORE="$ProgramFiles\PowerShell\pwsh.exe" + +# PowerShell +COPY --from=base ["C:/Program Files/PowerShell", "C:/Program Files/PowerShell"] + +# In order to set system PATH, ContainerAdministrator must be used +USER ContainerAdministrator +RUN setx /M PATH "%PATH%;%ProgramFiles%\PowerShell" +USER ContainerUser + +# intialize powershell module cache +RUN pwsh -NoLogo -NoProfile -Command " \ + $stopTime = (get-date).AddMinutes(15); \ + $ErrorActionPreference = 'Stop' ; \ + $ProgressPreference = 'SilentlyContinue' ; \ + while(!(Test-Path -Path $env:PSModuleAnalysisCachePath)) { \ + Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \ + if((get-date) -gt $stopTime) { throw 'timout expired'} \ + Start-Sleep -Seconds 6 ; \ + }" + +COPY --from=base ["C:/Program Files/Java/OpenJDK", "C:/Program Files/Java/OpenJDK"] + +ENV JAVA_HOME="C:\Program Files\Java\OpenJDK" \ + CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" + +COPY --chown=ContainerUser --from=base /BuildAgent /BuildAgent + +VOLUME C:/BuildAgent/conf +VOLUME C:/BuildAgent/work +VOLUME C:/BuildAgent/temp +VOLUME C:/BuildAgent/logs + +CMD ["pwsh", "./BuildAgent/run-agent.ps1"] diff --git a/configs/windows/MinimalAgent/nanoserver/NanoServer2022.Dockerignore b/configs/windows/MinimalAgent/nanoserver/NanoServer2022.Dockerignore new file mode 100644 index 000000000..6e126ca56 --- /dev/null +++ b/configs/windows/MinimalAgent/nanoserver/NanoServer2022.Dockerignore @@ -0,0 +1,3 @@ +TeamCity/webapps +TeamCity/devPackage +TeamCity/lib \ No newline at end of file diff --git a/configs/windows/Server/nanoserver/2004/NanoServer1809.Dockerfile.config b/configs/windows/Server/nanoserver/2022/NanoServer2022.Dockerfile.config similarity index 51% rename from configs/windows/Server/nanoserver/2004/NanoServer1809.Dockerfile.config rename to configs/windows/Server/nanoserver/2022/NanoServer2022.Dockerfile.config index 7c7bbcd5f..4cee49932 100644 --- a/configs/windows/Server/nanoserver/2004/NanoServer1809.Dockerfile.config +++ b/configs/windows/Server/nanoserver/2022/NanoServer2022.Dockerfile.config @@ -1,7 +1,7 @@ -windowsBuild=2004 +windowsBuild=2022 tag=nanoserver-${windowsBuild} repo=https://hub.docker.com/r/jetbrains/ # https://hub.docker.com/_/microsoft-powershell -powershellImage=mcr.microsoft.com/powershell:nanoserver-${windowsBuild} +powershellImage=mcr.microsoft.com/powershell:nanoserver-ltsc${windowsBuild} # https://hub.docker.com/_/microsoft-windows-nanoserver -nanoserverImage=mcr.microsoft.com/windows/nanoserver:${windowsBuild} \ No newline at end of file +nanoserverImage=mcr.microsoft.com/windows/nanoserver:ltsc${windowsBuild} \ No newline at end of file diff --git a/configs/windows/Server/nanoserver/NanoServer2022.Dockerfile b/configs/windows/Server/nanoserver/NanoServer2022.Dockerfile new file mode 100644 index 000000000..d2543b402 --- /dev/null +++ b/configs/windows/Server/nanoserver/NanoServer2022.Dockerfile @@ -0,0 +1,124 @@ +# The list of required arguments +# ARG powershellImage +# ARG jdkServerWindowsComponent +# ARG jdkServerWindowsComponentMD5SUM +# ARG gitWindowsComponent +# ARG gitWindowsComponentSHA256 +# ARG windowsBuild +# ARG powershellImage + +# Id teamcity-server +# Tag ${versionTag}-${tag} +# Tag ${latestTag} +# Tag ${versionTag} +# Platform ${windowsPlatform} +# Repo ${repo} +# Weight 3 +# Requires teamcity.agent.jvm.os.name contains Windows 10 + +## ${serverCommentHeader} + +# @AddToolToDoc [${jdkServerWindowsComponentName}](${jdkServerWindowsComponent}) +# @AddToolToDoc ${powerShellComponentName} +# @AddToolToDoc [${gitWindowsComponentName}](${gitWindowsComponent}) + +# Based on ${powershellImage} 3 +# PowerShell +FROM ${powershellImage} AS base + +# On some agents, Windows 2022 requires administrator permissions to modify "C:/" folder within ... +# ... PowerShell container. +USER ContainerAdministrator + +COPY scripts/*.cs /scripts/ +SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# JDK +ARG jdkServerWindowsComponent +ARG jdkServerWindowsComponentMD5SUM + +# Git +ARG gitWindowsComponent +ARG gitWindowsComponentSHA256 + +RUN [Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11, tls' ; \ + $code = Get-Content -Path "scripts/Web.cs" -Raw ; \ + # Use basic parsing to prevent errors in Windows Server 2022 + $Global:ProgressPreference = 'SilentlyContinue' ; \ + $Global:UseBasicParsing = $true ; \ + # Download actual target files + Add-Type -IgnoreWarnings -TypeDefinition "$code" -Language CSharp ; \ + $downloadScript = [Scripts.Web]::DownloadFiles($Env:jdkServerWindowsComponent + '#MD5#' + $Env:jdkServerWindowsComponentMD5SUM, 'jdk.zip', $Env:gitWindowsComponent + '#SHA256#' + $Env:gitWindowsComponentSHA256, 'git.zip') ; \ + iex $downloadScript ; \ + Expand-Archive jdk.zip -DestinationPath $Env:ProgramFiles\Java ; \ + Get-ChildItem $Env:ProgramFiles\Java | Rename-Item -NewName "OpenJDK" ; \ + Remove-Item -Force jdk.zip ; \ + Remove-Item $Env:ProgramFiles\Java\OpenJDK\lib\src.zip -Force ; \ + Expand-Archive git.zip -DestinationPath $Env:ProgramFiles\Git ; \ + # https://youtrack.jetbrains.com/issue/TW-73017 + (Get-Content 'C:\Program Files\Git\etc\gitconfig') -replace 'path = C:/Program Files/Git/etc/gitconfig', '' | Set-Content 'C:\Program Files\Git\etc\gitconfig' ; \ + Remove-Item -Force git.zip + +# Prepare TeamCity server distribution +ARG windowsBuild + +COPY TeamCity /TeamCity +RUN New-Item C:/TeamCity/webapps/ROOT/WEB-INF/DistributionType.txt -type file -force -value "docker-windows-$Env:windowsBuild" | Out-Null +COPY run-server.ps1 /TeamCity/run-server.ps1 + +USER ContainerUser + +# Workaround for https://github.com/PowerShell/PowerShell-Docker/issues/164 +ARG nanoserverImage + +FROM ${nanoserverImage} + +ENV ProgramFiles="C:\Program Files" \ + # set a fixed location for the Module analysis cache + PSModuleAnalysisCachePath="C:\Users\ContainerUser\AppData\Local\Microsoft\Windows\PowerShell\docker\ModuleAnalysisCache" \ + # Persist %PSCORE% ENV variable for user convenience + PSCORE="$ProgramFiles\PowerShell\pwsh.exe" + +COPY --from=base ["C:/Program Files/PowerShell", "C:/Program Files/PowerShell"] + +# In order to set system PATH, ContainerAdministrator must be used +USER ContainerAdministrator +RUN setx /M PATH "%PATH%;%ProgramFiles%\PowerShell" +USER ContainerUser + +# intialize powershell module cache +RUN pwsh -NoLogo -NoProfile -Command " \ + $stopTime = (get-date).AddMinutes(15); \ + $ErrorActionPreference = 'Stop' ; \ + $ProgressPreference = 'SilentlyContinue' ; \ + while(!(Test-Path -Path $env:PSModuleAnalysisCachePath)) { \ + Write-Host "'Waiting for $env:PSModuleAnalysisCachePath'" ; \ + if((get-date) -gt $stopTime) { throw 'timout expired'} \ + Start-Sleep -Seconds 6 ; \ + }" + +COPY --from=base ["C:/Program Files/Java/OpenJDK", "C:/Program Files/Java/OpenJDK"] +COPY --from=base ["C:/Program Files/Git", "C:/Program Files/Git"] + +ENV JAVA_HOME="C:\Program Files\Java\OpenJDK" \ + TEAMCITY_DIST="C:\TeamCity" \ + TEAMCITY_ENV=container \ + CATALINA_TMPDIR="C:\TeamCity\temp" \ + TEAMCITY_LOGS="C:\TeamCity\logs" \ + TEAMCITY_DATA_PATH="C:\ProgramData\JetBrains\TeamCity" \ + TEAMCITY_SERVER_MEM_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=640m" + +EXPOSE 8111 + +COPY --from=base $TEAMCITY_DIST $TEAMCITY_DIST + +VOLUME $TEAMCITY_DATA_PATH \ + $TEAMCITY_LOGS \ + $CATALINA_TMPDIR + +CMD ["pwsh", "C:/TeamCity/run-server.ps1"] + +# In order to set system PATH, ContainerAdministrator must be used +USER ContainerAdministrator +RUN setx /M PATH "%PATH%;%JAVA_HOME%\bin;C:\Program Files\Git\cmd" +USER ContainerUser \ No newline at end of file diff --git a/configs/windows/Server/nanoserver/NanoServer2022.Dockerignore b/configs/windows/Server/nanoserver/NanoServer2022.Dockerignore new file mode 100644 index 000000000..954df38d8 --- /dev/null +++ b/configs/windows/Server/nanoserver/NanoServer2022.Dockerignore @@ -0,0 +1,2 @@ +TeamCity/buildAgent +TeamCity/temp \ No newline at end of file diff --git a/context/generated/teamcity-agent-EAP-nanoserver-2004.cmd b/context/generated/teamcity-agent-EAP-nanoserver-2004.cmd deleted file mode 100644 index 80dd4bb24..000000000 --- a/context/generated/teamcity-agent-EAP-nanoserver-2004.cmd +++ /dev/null @@ -1,10 +0,0 @@ -cd ../.. -docker pull mcr.microsoft.com/windows/nanoserver:2004 -docker pull mcr.microsoft.com/powershell:nanoserver-2004 -docker pull mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-2004 -echo TeamCity/webapps > context/.dockerignore -echo TeamCity/devPackage >> context/.dockerignore -echo TeamCity/lib >> context/.dockerignore -docker build -f "context/generated/windows/MinimalAgent/nanoserver/2004/Dockerfile" -t teamcity-minimal-agent:EAP-nanoserver-2004 "context" -docker build -f "context/generated/windows/Agent/windowsservercore/2004/Dockerfile" -t teamcity-agent:EAP-windowsservercore-2004 "context" -docker build -f "context/generated/windows/Agent/nanoserver/2004/Dockerfile" -t teamcity-agent:EAP-nanoserver-2004 "context" diff --git a/context/generated/teamcity-agent-EAP-nanoserver-2022.cmd b/context/generated/teamcity-agent-EAP-nanoserver-2022.cmd new file mode 100644 index 000000000..fee5262b7 --- /dev/null +++ b/context/generated/teamcity-agent-EAP-nanoserver-2022.cmd @@ -0,0 +1,10 @@ +cd ../.. +docker pull mcr.microsoft.com/windows/nanoserver:ltsc2022 +docker pull mcr.microsoft.com/powershell:nanoserver-ltsc2022 +docker pull mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022 +echo TeamCity/webapps > context/.dockerignore +echo TeamCity/devPackage >> context/.dockerignore +echo TeamCity/lib >> context/.dockerignore +docker build -f "context/generated/windows/MinimalAgent/nanoserver/2022/Dockerfile" -t teamcity-minimal-agent:EAP-nanoserver-2022 "context" +docker build -f "context/generated/windows/Agent/windowsservercore/2022/Dockerfile" -t teamcity-agent:EAP-windowsservercore-2022 "context" +docker build -f "context/generated/windows/Agent/nanoserver/2022/Dockerfile" -t teamcity-agent:EAP-nanoserver-2022 "context" diff --git a/context/generated/teamcity-agent-EAP-windowsservercore-2004.cmd b/context/generated/teamcity-agent-EAP-windowsservercore-2022.cmd similarity index 55% rename from context/generated/teamcity-agent-EAP-windowsservercore-2004.cmd rename to context/generated/teamcity-agent-EAP-windowsservercore-2022.cmd index 5cab510fd..5c12e7951 100644 --- a/context/generated/teamcity-agent-EAP-windowsservercore-2004.cmd +++ b/context/generated/teamcity-agent-EAP-windowsservercore-2022.cmd @@ -1,9 +1,9 @@ cd ../.. -docker pull mcr.microsoft.com/windows/nanoserver:2004 -docker pull mcr.microsoft.com/powershell:nanoserver-2004 -docker pull mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-2004 +docker pull mcr.microsoft.com/windows/nanoserver:ltsc2022 +docker pull mcr.microsoft.com/powershell:nanoserver-ltsc2022 +docker pull mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022 echo TeamCity/webapps > context/.dockerignore echo TeamCity/devPackage >> context/.dockerignore echo TeamCity/lib >> context/.dockerignore -docker build -f "context/generated/windows/MinimalAgent/nanoserver/2004/Dockerfile" -t teamcity-minimal-agent:EAP-nanoserver-2004 "context" -docker build -f "context/generated/windows/Agent/windowsservercore/2004/Dockerfile" -t teamcity-agent:EAP-windowsservercore-2004 "context" +docker build -f "context/generated/windows/MinimalAgent/nanoserver/2022/Dockerfile" -t teamcity-minimal-agent:EAP-nanoserver-2022 "context" +docker build -f "context/generated/windows/Agent/windowsservercore/2022/Dockerfile" -t teamcity-agent:EAP-windowsservercore-2022 "context" diff --git a/context/generated/teamcity-agent.md b/context/generated/teamcity-agent.md index 2b1e0a28d..11339ed8e 100644 --- a/context/generated/teamcity-agent.md +++ b/context/generated/teamcity-agent.md @@ -29,9 +29,9 @@ When running an image with multi-architecture support, docker will automatically #### windows -- 2004 - - [EAP-nanoserver-2004](#EAP-nanoserver-2004) - - [EAP-windowsservercore-2004](#EAP-windowsservercore-2004) +- 2022 + - [EAP-nanoserver-2022](#EAP-nanoserver-2022) + - [EAP-windowsservercore-2022](#EAP-windowsservercore-2022) - 1909 - [EAP-nanoserver-1909](#EAP-nanoserver-1909) - [EAP-windowsservercore-1909](#EAP-windowsservercore-1909) @@ -48,23 +48,23 @@ When running an image with multi-architecture support, docker will automatically ### EAP -Supported platforms: linux 20.04, windows 1809, windows 2004 +Supported platforms: linux 20.04, windows 1809, windows 2022 #### Content - [EAP-linux](#EAP-linux) - [EAP-linux-arm64](#EAP-linux-arm64) - [EAP-nanoserver-1809](#EAP-nanoserver-1809) -- [EAP-nanoserver-2004](#EAP-nanoserver-2004) +- [EAP-nanoserver-2022](#EAP-nanoserver-2022) ### EAP-windowsservercore -Supported platforms: windows 1809, windows 2004 +Supported platforms: windows 1809, windows 2022 #### Content - [EAP-windowsservercore-1809](#EAP-windowsservercore-1809) -- [EAP-windowsservercore-2004](#EAP-windowsservercore-2004) +- [EAP-windowsservercore-2022](#EAP-windowsservercore-2022) ### EAP-linux @@ -266,9 +266,9 @@ docker build -f "context/generated/windows/Agent/nanoserver/1809/Dockerfile" -t _The required free space to generate image(s) is about **40 GB**._ -### EAP-nanoserver-2004 +### EAP-nanoserver-2022 -[Dockerfile](windows/Agent/nanoserver/2004/Dockerfile) +[Dockerfile](windows/Agent/nanoserver/2022/Dockerfile) This is an official [JetBrains TeamCity](https://www.jetbrains.com/teamcity/) build agent image. @@ -288,15 +288,15 @@ Container platform: windows Docker build commands: ``` -docker pull mcr.microsoft.com/windows/nanoserver:2004 -docker pull mcr.microsoft.com/powershell:nanoserver-2004 -docker pull mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-2004 +docker pull mcr.microsoft.com/windows/nanoserver:ltsc2022 +docker pull mcr.microsoft.com/powershell:nanoserver-ltsc2022 +docker pull mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022 echo TeamCity/webapps > context/.dockerignore echo TeamCity/devPackage >> context/.dockerignore echo TeamCity/lib >> context/.dockerignore -docker build -f "context/generated/windows/MinimalAgent/nanoserver/2004/Dockerfile" -t teamcity-minimal-agent:EAP-nanoserver-2004 "context" -docker build -f "context/generated/windows/Agent/windowsservercore/2004/Dockerfile" -t teamcity-agent:EAP-windowsservercore-2004 "context" -docker build -f "context/generated/windows/Agent/nanoserver/2004/Dockerfile" -t teamcity-agent:EAP-nanoserver-2004 "context" +docker build -f "context/generated/windows/MinimalAgent/nanoserver/2022/Dockerfile" -t teamcity-minimal-agent:EAP-nanoserver-2022 "context" +docker build -f "context/generated/windows/Agent/windowsservercore/2022/Dockerfile" -t teamcity-agent:EAP-windowsservercore-2022 "context" +docker build -f "context/generated/windows/Agent/nanoserver/2022/Dockerfile" -t teamcity-agent:EAP-nanoserver-2022 "context" ``` _The required free space to generate image(s) is about **40 GB**._ @@ -336,9 +336,9 @@ docker build -f "context/generated/windows/Agent/windowsservercore/1809/Dockerfi _The required free space to generate image(s) is about **38 GB**._ -### EAP-windowsservercore-2004 +### EAP-windowsservercore-2022 -[Dockerfile](windows/Agent/windowsservercore/2004/Dockerfile) +[Dockerfile](windows/Agent/windowsservercore/2022/Dockerfile) This is an official [JetBrains TeamCity](https://www.jetbrains.com/teamcity/) build agent image. @@ -359,14 +359,14 @@ Container platform: windows Docker build commands: ``` -docker pull mcr.microsoft.com/windows/nanoserver:2004 -docker pull mcr.microsoft.com/powershell:nanoserver-2004 -docker pull mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-2004 +docker pull mcr.microsoft.com/windows/nanoserver:ltsc2022 +docker pull mcr.microsoft.com/powershell:nanoserver-ltsc2022 +docker pull mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022 echo TeamCity/webapps > context/.dockerignore echo TeamCity/devPackage >> context/.dockerignore echo TeamCity/lib >> context/.dockerignore -docker build -f "context/generated/windows/MinimalAgent/nanoserver/2004/Dockerfile" -t teamcity-minimal-agent:EAP-nanoserver-2004 "context" -docker build -f "context/generated/windows/Agent/windowsservercore/2004/Dockerfile" -t teamcity-agent:EAP-windowsservercore-2004 "context" +docker build -f "context/generated/windows/MinimalAgent/nanoserver/2022/Dockerfile" -t teamcity-minimal-agent:EAP-nanoserver-2022 "context" +docker build -f "context/generated/windows/Agent/windowsservercore/2022/Dockerfile" -t teamcity-agent:EAP-windowsservercore-2022 "context" ``` _The required free space to generate image(s) is about **38 GB**._ diff --git a/context/generated/teamcity-minimal-agent-EAP-nanoserver-2004.cmd b/context/generated/teamcity-minimal-agent-EAP-nanoserver-2022.cmd similarity index 51% rename from context/generated/teamcity-minimal-agent-EAP-nanoserver-2004.cmd rename to context/generated/teamcity-minimal-agent-EAP-nanoserver-2022.cmd index 436cb59fa..d0cd01b30 100644 --- a/context/generated/teamcity-minimal-agent-EAP-nanoserver-2004.cmd +++ b/context/generated/teamcity-minimal-agent-EAP-nanoserver-2022.cmd @@ -1,7 +1,7 @@ cd ../.. -docker pull mcr.microsoft.com/windows/nanoserver:2004 -docker pull mcr.microsoft.com/powershell:nanoserver-2004 +docker pull mcr.microsoft.com/windows/nanoserver:ltsc2022 +docker pull mcr.microsoft.com/powershell:nanoserver-ltsc2022 echo TeamCity/webapps > context/.dockerignore echo TeamCity/devPackage >> context/.dockerignore echo TeamCity/lib >> context/.dockerignore -docker build -f "context/generated/windows/MinimalAgent/nanoserver/2004/Dockerfile" -t teamcity-minimal-agent:EAP-nanoserver-2004 "context" +docker build -f "context/generated/windows/MinimalAgent/nanoserver/2022/Dockerfile" -t teamcity-minimal-agent:EAP-nanoserver-2022 "context" diff --git a/context/generated/teamcity-minimal-agent.md b/context/generated/teamcity-minimal-agent.md index a775dcb3c..d59f76ec9 100644 --- a/context/generated/teamcity-minimal-agent.md +++ b/context/generated/teamcity-minimal-agent.md @@ -22,8 +22,8 @@ When running an image with multi-architecture support, docker will automatically #### windows -- 2004 - - [EAP-nanoserver-2004](#EAP-nanoserver-2004) +- 2022 + - [EAP-nanoserver-2022](#EAP-nanoserver-2022) - 1909 - [EAP-nanoserver-1909](#EAP-nanoserver-1909) - 1903 @@ -36,13 +36,13 @@ When running an image with multi-architecture support, docker will automatically ### EAP -Supported platforms: linux 20.04, windows 1809, windows 2004 +Supported platforms: linux 20.04, windows 1809, windows 2022 #### Content - [EAP-linux](#EAP-linux) - [EAP-nanoserver-1809](#EAP-nanoserver-1809) -- [EAP-nanoserver-2004](#EAP-nanoserver-2004) +- [EAP-nanoserver-2022](#EAP-nanoserver-2022) ### EAP-linux @@ -104,9 +104,9 @@ docker build -f "context/generated/windows/MinimalAgent/nanoserver/1809/Dockerfi _The required free space to generate image(s) is about **10 GB**._ -### EAP-nanoserver-2004 +### EAP-nanoserver-2022 -[Dockerfile](windows/MinimalAgent/nanoserver/2004/Dockerfile) +[Dockerfile](windows/MinimalAgent/nanoserver/2022/Dockerfile) This is an official [JetBrains TeamCity](https://www.jetbrains.com/teamcity/) build agent image. @@ -124,12 +124,12 @@ Container platform: windows Docker build commands: ``` -docker pull mcr.microsoft.com/windows/nanoserver:2004 -docker pull mcr.microsoft.com/powershell:nanoserver-2004 +docker pull mcr.microsoft.com/windows/nanoserver:ltsc2022 +docker pull mcr.microsoft.com/powershell:nanoserver-ltsc2022 echo TeamCity/webapps > context/.dockerignore echo TeamCity/devPackage >> context/.dockerignore echo TeamCity/lib >> context/.dockerignore -docker build -f "context/generated/windows/MinimalAgent/nanoserver/2004/Dockerfile" -t teamcity-minimal-agent:EAP-nanoserver-2004 "context" +docker build -f "context/generated/windows/MinimalAgent/nanoserver/2022/Dockerfile" -t teamcity-minimal-agent:EAP-nanoserver-2022 "context" ``` _The required free space to generate image(s) is about **10 GB**._ diff --git a/context/generated/teamcity-server-EAP-nanoserver-2004.cmd b/context/generated/teamcity-server-EAP-nanoserver-2004.cmd deleted file mode 100644 index 39de36132..000000000 --- a/context/generated/teamcity-server-EAP-nanoserver-2004.cmd +++ /dev/null @@ -1,5 +0,0 @@ -cd ../.. -docker pull mcr.microsoft.com/powershell:nanoserver-2004 -echo TeamCity/buildAgent > context/.dockerignore -echo TeamCity/temp >> context/.dockerignore -docker build -f "context/generated/windows/Server/nanoserver/2004/Dockerfile" -t teamcity-server:EAP-nanoserver-2004 "context" diff --git a/context/generated/teamcity-server-EAP-nanoserver-2022.cmd b/context/generated/teamcity-server-EAP-nanoserver-2022.cmd new file mode 100644 index 000000000..d365cea15 --- /dev/null +++ b/context/generated/teamcity-server-EAP-nanoserver-2022.cmd @@ -0,0 +1,5 @@ +cd ../.. +docker pull mcr.microsoft.com/powershell:nanoserver-ltsc2022 +echo TeamCity/buildAgent > context/.dockerignore +echo TeamCity/temp >> context/.dockerignore +docker build -f "context/generated/windows/Server/nanoserver/2022/Dockerfile" -t teamcity-server:EAP-nanoserver-2022 "context" diff --git a/context/generated/teamcity-server.md b/context/generated/teamcity-server.md index ca8d64cdb..61b238fab 100644 --- a/context/generated/teamcity-server.md +++ b/context/generated/teamcity-server.md @@ -22,8 +22,8 @@ When running an image with multi-architecture support, docker will automatically #### windows -- 2004 - - [EAP-nanoserver-2004](#EAP-nanoserver-2004) +- 2022 + - [EAP-nanoserver-2022](#EAP-nanoserver-2022) - 1909 - [EAP-nanoserver-1909](#EAP-nanoserver-1909) - 1903 @@ -36,13 +36,13 @@ When running an image with multi-architecture support, docker will automatically ### EAP -Supported platforms: linux 20.04, windows 1809, windows 2004 +Supported platforms: linux 20.04, windows 1809, windows 2022 #### Content - [EAP-linux](#EAP-linux) - [EAP-nanoserver-1809](#EAP-nanoserver-1809) -- [EAP-nanoserver-2004](#EAP-nanoserver-2004) +- [EAP-nanoserver-2022](#EAP-nanoserver-2022) ### EAP-linux @@ -104,9 +104,9 @@ docker build -f "context/generated/windows/Server/nanoserver/1809/Dockerfile" -t _The required free space to generate image(s) is about **6 GB**._ -### EAP-nanoserver-2004 +### EAP-nanoserver-2022 -[Dockerfile](windows/Server/nanoserver/2004/Dockerfile) +[Dockerfile](windows/Server/nanoserver/2022/Dockerfile) This is an official [JetBrains TeamCity](https://www.jetbrains.com/teamcity/) server image. The image is suitable for production use and evaluation purposes. @@ -125,10 +125,10 @@ Container platform: windows Docker build commands: ``` -docker pull mcr.microsoft.com/powershell:nanoserver-2004 +docker pull mcr.microsoft.com/powershell:nanoserver-ltsc2022 echo TeamCity/buildAgent > context/.dockerignore echo TeamCity/temp >> context/.dockerignore -docker build -f "context/generated/windows/Server/nanoserver/2004/Dockerfile" -t teamcity-server:EAP-nanoserver-2004 "context" +docker build -f "context/generated/windows/Server/nanoserver/2022/Dockerfile" -t teamcity-server:EAP-nanoserver-2022 "context" ``` _The required free space to generate image(s) is about **6 GB**._ diff --git a/context/generated/windows/Agent/nanoserver/1803/Dockerfile b/context/generated/windows/Agent/nanoserver/1803/Dockerfile index f1217d653..088758529 100644 --- a/context/generated/windows/Agent/nanoserver/1803/Dockerfile +++ b/context/generated/windows/Agent/nanoserver/1803/Dockerfile @@ -45,7 +45,7 @@ VOLUME C:/BuildAgent/conf CMD ["pwsh", "./BuildAgent/run-agent.ps1"] # Configuration file for TeamCity agent -ENV CONFIG_FILE="C:/BuildAgent/conf/buildAgent.properties" \ +ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \ # Java home directory JAVA_HOME="C:\Program Files\Java\OpenJDK" \ # Opt out of the telemetry feature diff --git a/context/generated/windows/Agent/nanoserver/1809/Dockerfile b/context/generated/windows/Agent/nanoserver/1809/Dockerfile index 18bcf0543..2a37a6bb4 100644 --- a/context/generated/windows/Agent/nanoserver/1809/Dockerfile +++ b/context/generated/windows/Agent/nanoserver/1809/Dockerfile @@ -61,7 +61,7 @@ EXPOSE 9090 VOLUME C:/BuildAgent/conf # Configuration file for TeamCity agent -ENV CONFIG_FILE="C:/BuildAgent/conf/buildAgent.properties" \ +ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \ # Java home directory JAVA_HOME="C:\Program Files\Java\OpenJDK" \ # Opt out of the telemetry feature diff --git a/context/generated/windows/Agent/nanoserver/1903/Dockerfile b/context/generated/windows/Agent/nanoserver/1903/Dockerfile index fed17c040..bcfb7477f 100644 --- a/context/generated/windows/Agent/nanoserver/1903/Dockerfile +++ b/context/generated/windows/Agent/nanoserver/1903/Dockerfile @@ -61,7 +61,7 @@ EXPOSE 9090 VOLUME C:/BuildAgent/conf # Configuration file for TeamCity agent -ENV CONFIG_FILE="C:/BuildAgent/conf/buildAgent.properties" \ +ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \ # Java home directory JAVA_HOME="C:\Program Files\Java\OpenJDK" \ # Opt out of the telemetry feature diff --git a/context/generated/windows/Agent/nanoserver/1909/Dockerfile b/context/generated/windows/Agent/nanoserver/1909/Dockerfile index 578b4f15d..8fc097b91 100644 --- a/context/generated/windows/Agent/nanoserver/1909/Dockerfile +++ b/context/generated/windows/Agent/nanoserver/1909/Dockerfile @@ -61,7 +61,7 @@ EXPOSE 9090 VOLUME C:/BuildAgent/conf # Configuration file for TeamCity agent -ENV CONFIG_FILE="C:/BuildAgent/conf/buildAgent.properties" \ +ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \ # Java home directory JAVA_HOME="C:\Program Files\Java\OpenJDK" \ # Opt out of the telemetry feature diff --git a/context/generated/windows/Agent/nanoserver/2004/Dockerfile b/context/generated/windows/Agent/nanoserver/2022/Dockerfile similarity index 89% rename from context/generated/windows/Agent/nanoserver/2004/Dockerfile rename to context/generated/windows/Agent/nanoserver/2022/Dockerfile index 32163739a..b72ee86e4 100644 --- a/context/generated/windows/Agent/nanoserver/2004/Dockerfile +++ b/context/generated/windows/Agent/nanoserver/2022/Dockerfile @@ -1,7 +1,7 @@ # Default arguments -ARG nanoserverImage='mcr.microsoft.com/windows/nanoserver:2004' -ARG powershellImage='mcr.microsoft.com/powershell:nanoserver-2004' -ARG teamcityWindowsservercoreImage='teamcity-agent:EAP-windowsservercore-2004' +ARG nanoserverImage='mcr.microsoft.com/windows/nanoserver:ltsc2022' +ARG powershellImage='mcr.microsoft.com/powershell:nanoserver-ltsc2022' +ARG teamcityWindowsservercoreImage='teamcity-agent:EAP-windowsservercore-2022' # The list of required arguments # ARG nanoserverImage @@ -13,6 +13,10 @@ ARG teamcityWindowsservercoreImage='teamcity-agent:EAP-windowsservercore-2004' FROM ${powershellImage} AS dotnet +# On some agents, Windows 2022 requires administrator permissions to modify "C:/" folder within ... +# ... PowerShell container. +USER ContainerAdministrator + COPY scripts/*.cs /scripts/ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -61,7 +65,7 @@ EXPOSE 9090 VOLUME C:/BuildAgent/conf # Configuration file for TeamCity agent -ENV CONFIG_FILE="C:/BuildAgent/conf/buildAgent.properties" \ +ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \ # Java home directory JAVA_HOME="C:\Program Files\Java\OpenJDK" \ # Opt out of the telemetry feature diff --git a/context/generated/windows/Agent/windowsservercore/1803/Dockerfile b/context/generated/windows/Agent/windowsservercore/1803/Dockerfile index 52cfb7221..bb261a06d 100644 --- a/context/generated/windows/Agent/windowsservercore/1803/Dockerfile +++ b/context/generated/windows/Agent/windowsservercore/1803/Dockerfile @@ -46,7 +46,7 @@ RUN [Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11, tls' ; \ Add-Type -IgnoreWarnings -TypeDefinition "$code" -Language CSharp ; \ $downloadScript = [Scripts.Web]::DownloadFiles($Env:jdkWindowsComponent + '#MD5#' + $Env:jdkWindowsComponentMD5SUM, 'jdk.zip', $Env:gitWindowsComponent + '#SHA256#' + $Env:gitWindowsComponentSHA256, 'git.zip', $Env:mercurialWindowsComponent, 'hg.msi', $Env:dotnetWindowsComponent + '#SHA512#' + $Env:dotnetWindowsComponentSHA512, 'dotnet.zip') ; \ Remove-Item -Force -Recurse $Env:ProgramFiles\dotnet; \ -# .NET 6.0 +# .NET 6.0, .NET Framework 4 is inherited from base image Expand-Archive dotnet.zip -Force -DestinationPath $Env:ProgramFiles\dotnet; \ Remove-Item -Force dotnet.zip; \ Get-ChildItem -Path $Env:ProgramFiles\dotnet -Include *.lzma -File -Recurse | foreach { $_.Delete()}; \ @@ -77,7 +77,7 @@ VOLUME C:/BuildAgent/conf CMD ["pwsh", "./BuildAgent/run-agent.ps1"] # Configuration file for TeamCity agent -ENV CONFIG_FILE="C:/BuildAgent/conf/buildAgent.properties" \ +ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \ # Java home directory JAVA_HOME="C:\Program Files\Java\OpenJDK" \ # Opt out of the telemetry feature diff --git a/context/generated/windows/Agent/windowsservercore/1809/Dockerfile b/context/generated/windows/Agent/windowsservercore/1809/Dockerfile index 76c95fe9e..7ae6f16ca 100644 --- a/context/generated/windows/Agent/windowsservercore/1809/Dockerfile +++ b/context/generated/windows/Agent/windowsservercore/1809/Dockerfile @@ -46,7 +46,7 @@ RUN [Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11, tls' ; \ Add-Type -IgnoreWarnings -TypeDefinition "$code" -Language CSharp ; \ $downloadScript = [Scripts.Web]::DownloadFiles($Env:jdkWindowsComponent + '#MD5#' + $Env:jdkWindowsComponentMD5SUM, 'jdk.zip', $Env:gitWindowsComponent + '#SHA256#' + $Env:gitWindowsComponentSHA256, 'git.zip', $Env:mercurialWindowsComponent, 'hg.msi', $Env:dotnetWindowsComponent + '#SHA512#' + $Env:dotnetWindowsComponentSHA512, 'dotnet.zip') ; \ Remove-Item -Force -Recurse $Env:ProgramFiles\dotnet; \ -# .NET 6.0 +# .NET 6.0, .NET Framework 4 is inherited from base image Expand-Archive dotnet.zip -Force -DestinationPath $Env:ProgramFiles\dotnet; \ Remove-Item -Force dotnet.zip; \ Get-ChildItem -Path $Env:ProgramFiles\dotnet -Include *.lzma -File -Recurse | foreach { $_.Delete()}; \ @@ -77,7 +77,7 @@ VOLUME C:/BuildAgent/conf CMD ["pwsh", "./BuildAgent/run-agent.ps1"] # Configuration file for TeamCity agent -ENV CONFIG_FILE="C:/BuildAgent/conf/buildAgent.properties" \ +ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \ # Java home directory JAVA_HOME="C:\Program Files\Java\OpenJDK" \ # Opt out of the telemetry feature diff --git a/context/generated/windows/Agent/windowsservercore/1903/Dockerfile b/context/generated/windows/Agent/windowsservercore/1903/Dockerfile index d55c5644c..ea4b80557 100644 --- a/context/generated/windows/Agent/windowsservercore/1903/Dockerfile +++ b/context/generated/windows/Agent/windowsservercore/1903/Dockerfile @@ -46,7 +46,7 @@ RUN [Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11, tls' ; \ Add-Type -IgnoreWarnings -TypeDefinition "$code" -Language CSharp ; \ $downloadScript = [Scripts.Web]::DownloadFiles($Env:jdkWindowsComponent + '#MD5#' + $Env:jdkWindowsComponentMD5SUM, 'jdk.zip', $Env:gitWindowsComponent + '#SHA256#' + $Env:gitWindowsComponentSHA256, 'git.zip', $Env:mercurialWindowsComponent, 'hg.msi', $Env:dotnetWindowsComponent + '#SHA512#' + $Env:dotnetWindowsComponentSHA512, 'dotnet.zip') ; \ Remove-Item -Force -Recurse $Env:ProgramFiles\dotnet; \ -# .NET 6.0 +# .NET 6.0, .NET Framework 4 is inherited from base image Expand-Archive dotnet.zip -Force -DestinationPath $Env:ProgramFiles\dotnet; \ Remove-Item -Force dotnet.zip; \ Get-ChildItem -Path $Env:ProgramFiles\dotnet -Include *.lzma -File -Recurse | foreach { $_.Delete()}; \ @@ -77,7 +77,7 @@ VOLUME C:/BuildAgent/conf CMD ["pwsh", "./BuildAgent/run-agent.ps1"] # Configuration file for TeamCity agent -ENV CONFIG_FILE="C:/BuildAgent/conf/buildAgent.properties" \ +ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \ # Java home directory JAVA_HOME="C:\Program Files\Java\OpenJDK" \ # Opt out of the telemetry feature diff --git a/context/generated/windows/Agent/windowsservercore/1909/Dockerfile b/context/generated/windows/Agent/windowsservercore/1909/Dockerfile index 9c4da7edd..580c6c52b 100644 --- a/context/generated/windows/Agent/windowsservercore/1909/Dockerfile +++ b/context/generated/windows/Agent/windowsservercore/1909/Dockerfile @@ -46,7 +46,7 @@ RUN [Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11, tls' ; \ Add-Type -IgnoreWarnings -TypeDefinition "$code" -Language CSharp ; \ $downloadScript = [Scripts.Web]::DownloadFiles($Env:jdkWindowsComponent + '#MD5#' + $Env:jdkWindowsComponentMD5SUM, 'jdk.zip', $Env:gitWindowsComponent + '#SHA256#' + $Env:gitWindowsComponentSHA256, 'git.zip', $Env:mercurialWindowsComponent, 'hg.msi', $Env:dotnetWindowsComponent + '#SHA512#' + $Env:dotnetWindowsComponentSHA512, 'dotnet.zip') ; \ Remove-Item -Force -Recurse $Env:ProgramFiles\dotnet; \ -# .NET 6.0 +# .NET 6.0, .NET Framework 4 is inherited from base image Expand-Archive dotnet.zip -Force -DestinationPath $Env:ProgramFiles\dotnet; \ Remove-Item -Force dotnet.zip; \ Get-ChildItem -Path $Env:ProgramFiles\dotnet -Include *.lzma -File -Recurse | foreach { $_.Delete()}; \ @@ -77,7 +77,7 @@ VOLUME C:/BuildAgent/conf CMD ["pwsh", "./BuildAgent/run-agent.ps1"] # Configuration file for TeamCity agent -ENV CONFIG_FILE="C:/BuildAgent/conf/buildAgent.properties" \ +ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \ # Java home directory JAVA_HOME="C:\Program Files\Java\OpenJDK" \ # Opt out of the telemetry feature diff --git a/context/generated/windows/Agent/windowsservercore/2004/Dockerfile b/context/generated/windows/Agent/windowsservercore/2022/Dockerfile similarity index 93% rename from context/generated/windows/Agent/windowsservercore/2004/Dockerfile rename to context/generated/windows/Agent/windowsservercore/2022/Dockerfile index ec27eef10..66dad7e62 100644 --- a/context/generated/windows/Agent/windowsservercore/2004/Dockerfile +++ b/context/generated/windows/Agent/windowsservercore/2022/Dockerfile @@ -6,8 +6,8 @@ ARG gitWindowsComponentSHA256='b945e6df773fd8013f12e26b65b6815122be62a241d3ef4b9 ARG jdkWindowsComponent='https://corretto.aws/downloads/resources/17.0.7.7.1/amazon-corretto-17.0.7.7.1-windows-x64-jdk.zip' ARG jdkWindowsComponentMD5SUM='feb7eab99c647a0b4347be9f0a3276de' ARG mercurialWindowsComponent='https://www.mercurial-scm.org/release/windows/mercurial-5.9.1-x64.msi' -ARG teamcityMinimalAgentImage='teamcity-minimal-agent:EAP-nanoserver-2004' -ARG windowsservercoreImage='mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-2004' +ARG teamcityMinimalAgentImage='teamcity-minimal-agent:EAP-nanoserver-2022' +ARG windowsservercoreImage='mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022' # The list of required arguments # ARG windowsservercoreImage @@ -28,6 +28,10 @@ FROM ${teamcityMinimalAgentImage} AS buildagent ARG windowsservercoreImage FROM ${windowsservercoreImage} +# On some agents, Windows 2022 requires administrator permissions to modify "C:/" folder within ... +# ... PowerShell container. +USER ContainerAdministrator + COPY scripts/*.cs /scripts/ # PowerShell @@ -46,7 +50,7 @@ RUN [Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11, tls' ; \ Add-Type -IgnoreWarnings -TypeDefinition "$code" -Language CSharp ; \ $downloadScript = [Scripts.Web]::DownloadFiles($Env:jdkWindowsComponent + '#MD5#' + $Env:jdkWindowsComponentMD5SUM, 'jdk.zip', $Env:gitWindowsComponent + '#SHA256#' + $Env:gitWindowsComponentSHA256, 'git.zip', $Env:mercurialWindowsComponent, 'hg.msi', $Env:dotnetWindowsComponent + '#SHA512#' + $Env:dotnetWindowsComponentSHA512, 'dotnet.zip') ; \ Remove-Item -Force -Recurse $Env:ProgramFiles\dotnet; \ -# .NET 6.0 +# .NET 6.0, .NET Framework 4 is inherited from base image Expand-Archive dotnet.zip -Force -DestinationPath $Env:ProgramFiles\dotnet; \ Remove-Item -Force dotnet.zip; \ Get-ChildItem -Path $Env:ProgramFiles\dotnet -Include *.lzma -File -Recurse | foreach { $_.Delete()}; \ @@ -77,7 +81,7 @@ VOLUME C:/BuildAgent/conf CMD ["pwsh", "./BuildAgent/run-agent.ps1"] # Configuration file for TeamCity agent -ENV CONFIG_FILE="C:/BuildAgent/conf/buildAgent.properties" \ +ENV CONFIG_FILE="C:\BuildAgent\conf\buildAgent.properties" \ # Java home directory JAVA_HOME="C:\Program Files\Java\OpenJDK" \ # Opt out of the telemetry feature diff --git a/context/generated/windows/MinimalAgent/nanoserver/2004/Dockerfile b/context/generated/windows/MinimalAgent/nanoserver/2022/Dockerfile similarity index 91% rename from context/generated/windows/MinimalAgent/nanoserver/2004/Dockerfile rename to context/generated/windows/MinimalAgent/nanoserver/2022/Dockerfile index b6489ce5a..126005e40 100644 --- a/context/generated/windows/MinimalAgent/nanoserver/2004/Dockerfile +++ b/context/generated/windows/MinimalAgent/nanoserver/2022/Dockerfile @@ -1,8 +1,8 @@ # Default arguments ARG jdkWindowsComponent='https://corretto.aws/downloads/resources/17.0.7.7.1/amazon-corretto-17.0.7.7.1-windows-x64-jdk.zip' ARG jdkWindowsComponentMD5SUM='feb7eab99c647a0b4347be9f0a3276de' -ARG nanoserverImage='mcr.microsoft.com/windows/nanoserver:2004' -ARG powershellImage='mcr.microsoft.com/powershell:nanoserver-2004' +ARG nanoserverImage='mcr.microsoft.com/windows/nanoserver:ltsc2022' +ARG powershellImage='mcr.microsoft.com/powershell:nanoserver-ltsc2022' # The list of required arguments # ARG jdkWindowsComponent @@ -15,6 +15,10 @@ ARG powershellImage='mcr.microsoft.com/powershell:nanoserver-2004' FROM ${powershellImage} AS base +# On some agents, Windows 2022 requires administrator permissions to modify "C:/" folder within ... +# ... PowerShell container. +USER ContainerAdministrator + COPY scripts/*.cs /scripts/ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] diff --git a/context/generated/windows/Server/nanoserver/2004/Dockerfile b/context/generated/windows/Server/nanoserver/2022/Dockerfile similarity index 88% rename from context/generated/windows/Server/nanoserver/2004/Dockerfile rename to context/generated/windows/Server/nanoserver/2022/Dockerfile index 0249c76d0..a38cf9c3a 100644 --- a/context/generated/windows/Server/nanoserver/2004/Dockerfile +++ b/context/generated/windows/Server/nanoserver/2022/Dockerfile @@ -3,9 +3,9 @@ ARG gitWindowsComponent='https://github.com/git-for-windows/git/releases/downloa ARG gitWindowsComponentSHA256='b945e6df773fd8013f12e26b65b6815122be62a241d3ef4b9ed2d5ae67ae0aa1' ARG jdkServerWindowsComponent='https://corretto.aws/downloads/resources/17.0.7.7.1/amazon-corretto-17.0.7.7.1-windows-x64-jdk.zip' ARG jdkServerWindowsComponentMD5SUM='feb7eab99c647a0b4347be9f0a3276de' -ARG nanoserverImage='mcr.microsoft.com/windows/nanoserver:2004' -ARG powershellImage='mcr.microsoft.com/powershell:nanoserver-2004' -ARG windowsBuild='2004' +ARG nanoserverImage='mcr.microsoft.com/windows/nanoserver:ltsc2022' +ARG powershellImage='mcr.microsoft.com/powershell:nanoserver-ltsc2022' +ARG windowsBuild='2022' # The list of required arguments # ARG powershellImage @@ -22,6 +22,10 @@ ARG windowsBuild='2004' # PowerShell FROM ${powershellImage} AS base +# On some agents, Windows 2022 requires administrator permissions to modify "C:/" folder within ... +# ... PowerShell container. +USER ContainerAdministrator + COPY scripts/*.cs /scripts/ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] @@ -35,6 +39,10 @@ ARG gitWindowsComponentSHA256 RUN [Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11, tls' ; \ $code = Get-Content -Path "scripts/Web.cs" -Raw ; \ + # Use basic parsing to prevent errors in Windows Server 2022 + $Global:ProgressPreference = 'SilentlyContinue' ; \ + $Global:UseBasicParsing = $true ; \ + # Download actual target files Add-Type -IgnoreWarnings -TypeDefinition "$code" -Language CSharp ; \ $downloadScript = [Scripts.Web]::DownloadFiles($Env:jdkServerWindowsComponent + '#MD5#' + $Env:jdkServerWindowsComponentMD5SUM, 'jdk.zip', $Env:gitWindowsComponent + '#SHA256#' + $Env:gitWindowsComponentSHA256, 'git.zip') ; \ iex $downloadScript ; \ @@ -54,6 +62,8 @@ COPY TeamCity /TeamCity RUN New-Item C:/TeamCity/webapps/ROOT/WEB-INF/DistributionType.txt -type file -force -value "docker-windows-$Env:windowsBuild" | Out-Null COPY run-server.ps1 /TeamCity/run-server.ps1 +USER ContainerUser + # Workaround for https://github.com/PowerShell/PowerShell-Docker/issues/164 ARG nanoserverImage diff --git a/context/scripts/Web.cs b/context/scripts/Web.cs index dd88ec3e5..590a510a3 100644 --- a/context/scripts/Web.cs +++ b/context/scripts/Web.cs @@ -126,10 +126,12 @@ private static async Task DownloadFile(string sourceUrl, string destinatio WriteLine("{0}\tdownloading from \"{1}\"", name, sourceUrl); } + WriteLine("[Download file task] Starting the download of the file ..."); if (await DownloadFile(name, sourceUrl, destinationFile)) { if (hashAlgorithm != null) { + WriteLine("[Download file task] Opening the file for read ..."); using (FileStream fileStream = File.OpenRead(destinationFile)) { byte[] computedHash = hashAlgorithm.ComputeHash(fileStream); @@ -224,6 +226,7 @@ private static async Task DownloadFile(string name, string sourceUrl, stri }; try { + WriteLine("[Download file task] Trying to download the file [{0}] ...", destinationFile); await client.DownloadFileTaskAsync(source, destinationFile); return completed; } catch (Exception fileDownloadException) { diff --git a/tool/TeamCity.Docker/ConfigurationExplorer.cs b/tool/TeamCity.Docker/ConfigurationExplorer.cs index 708566414..89a4d788a 100644 --- a/tool/TeamCity.Docker/ConfigurationExplorer.cs +++ b/tool/TeamCity.Docker/ConfigurationExplorer.cs @@ -60,6 +60,12 @@ public Result> Explore(string sourcePath, IEnumerable>(GetConfigurations(sourcePath, additionalVars)); } + /// + /// Generates "variants" - objects based on template Dockerfiles. + /// + /// path to folder with templates + /// Parameters for the substitution within Dockerfile template. + /// Tempalte objects private IEnumerable