content: # The list of required arguments
  # ARG powershellImage
  # ARG jdkServerWindowsComponent
  # ARG gitWindowsComponent
  # ARG windowsBuild
  # ARG powershellImage
  # ARG jdkServerWindowsComponent
  
  # Id teamcity-server
  # Tag ${versionTag}-${tag}
  # Tag ${latestTag}
  # Tag ${versionTag}
  # Platform ${windowsPlatform}
  # Repo ${repo}
  # Weight 3
  
  ## ${serverCommentHeader}
  
  # @AddToolToDoc [${jdkServerWindowsComponentName}](${jdkServerWindowsComponent})
  # @AddToolToDoc [${gitWindowsComponentName}](${gitWindowsComponent})
  # @AddToolToDoc ${powerShellComponentName}
  
  # Based on ${powershellImage} 3
  # PowerShell
  FROM ${powershellImage} AS base
  
  SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
  
  # JDK
  ARG jdkServerWindowsComponent
  
  RUN [Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11, tls' ; \
      Invoke-WebRequest $Env:jdkServerWindowsComponent -OutFile jdk.zip; \
      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
  
  # Git
  ARG gitWindowsComponent
  
  RUN [Net.ServicePointManager]::SecurityProtocol = 'tls12, tls11, tls' ; \
      Invoke-WebRequest $Env:gitWindowsComponent -OutFile git.zip; \
      Expand-Archive git.zip -DestinationPath $Env:ProgramFiles\Git ; \
      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
  
  ARG powershellImage
  
  FROM ${powershellImage}
  
  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
  