-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e11287
commit 9f0eb9c
Showing
8 changed files
with
105 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
context/generated/windows/Agent/windowsservercore/2004/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# Default arguments | ||
ARG dotnetWindowsComponent='https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.413/dotnet-sdk-6.0.413-win-x64.zip' | ||
ARG dotnetWindowsComponentSHA512='a9e1bbb52484ad0667b258451ebb6b47ce6c7b788c015aee8a86c5e0c4dcf4ee8c82d796921869d64c92bb2afef2c7ceea09cfe255d8519d48f2471a098c361e' | ||
ARG gitWindowsComponent='https://github.com/git-for-windows/git/releases/download/v2.43.0.windows.1/MinGit-2.43.0-64-bit.zip' | ||
ARG gitWindowsComponentSHA256='1905d93068e986258fafc69517df8fddff829bb2a289c1fa4dcc6cdf720ddf36' | ||
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:2023.11-nanoserver-2004' | ||
ARG windowsservercoreImage='mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-2004' | ||
|
||
# The list of required arguments | ||
# ARG windowsservercoreImage | ||
# ARG dotnetWindowsComponent | ||
# ARG dotnetWindowsComponentSHA512 | ||
# ARG jdkWindowsComponent | ||
# ARG jdkWindowsComponentMD5SUM | ||
# ARG gitWindowsComponent | ||
# ARG gitWindowsComponentSHA256 | ||
# ARG mercurialWindowsComponentName | ||
# ARG teamcityMinimalAgentImage | ||
|
||
|
||
|
||
|
||
FROM ${teamcityMinimalAgentImage} AS buildagent | ||
|
||
ARG windowsservercoreImage | ||
FROM ${windowsservercoreImage} | ||
|
||
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 ["powershell", "./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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters