From 89d5cc4c2a5c3526de9e4260bd320f35fcd3590e Mon Sep 17 00:00:00 2001 From: Chris Patterson Date: Wed, 16 Nov 2016 21:58:40 -0500 Subject: [PATCH 1/4] Initial scaffolding for windows docker files --- windows/nano/10.0.14393/Dockerfile | 8 ++ windows/nano/10.0.14393/Start.cmd | 1 + windows/nano/10.0.14393/Start.ps1 | 70 +++++++++++++++++ windows/nano/10.0.14393/standard/Dockerfile | 60 ++++++++++++++ windows/servercore/10.0.14393/Dockerfile | 8 ++ windows/servercore/10.0.14393/Start.cmd | 1 + windows/servercore/10.0.14393/Start.ps1 | 70 +++++++++++++++++ .../servercore/10.0.14393/standard/Dockerfile | 78 +++++++++++++++++++ 8 files changed, 296 insertions(+) create mode 100644 windows/nano/10.0.14393/Dockerfile create mode 100644 windows/nano/10.0.14393/Start.cmd create mode 100644 windows/nano/10.0.14393/Start.ps1 create mode 100644 windows/nano/10.0.14393/standard/Dockerfile create mode 100644 windows/servercore/10.0.14393/Dockerfile create mode 100644 windows/servercore/10.0.14393/Start.cmd create mode 100644 windows/servercore/10.0.14393/Start.ps1 create mode 100644 windows/servercore/10.0.14393/standard/Dockerfile diff --git a/windows/nano/10.0.14393/Dockerfile b/windows/nano/10.0.14393/Dockerfile new file mode 100644 index 0000000..15fb12d --- /dev/null +++ b/windows/nano/10.0.14393/Dockerfile @@ -0,0 +1,8 @@ +FROM microsoft/nanoserver:10.0.14393.447 +ENV WINDOWS_IMAGE_VERSION 10.0.14393.447 + +RUN mkdir C:\BuildAgent +WORKDIR C:/BuildAgent +COPY ./Start.* ./ + +CMD ["Start.cmd"] \ No newline at end of file diff --git a/windows/nano/10.0.14393/Start.cmd b/windows/nano/10.0.14393/Start.cmd new file mode 100644 index 0000000..f388b73 --- /dev/null +++ b/windows/nano/10.0.14393/Start.cmd @@ -0,0 +1 @@ +PowerShell.exe -ExecutionPolicy ByPass .\Start.ps1 diff --git a/windows/nano/10.0.14393/Start.ps1 b/windows/nano/10.0.14393/Start.ps1 new file mode 100644 index 0000000..c506272 --- /dev/null +++ b/windows/nano/10.0.14393/Start.ps1 @@ -0,0 +1,70 @@ +$ErrorActionPreference = "Stop" + +If ($env:VSTS_ACCOUNT -eq $null) { + Write-Error "Missing VSTS_ACCOUNT environment variable" + exit 1 +} + +if ($env:VSTS_TOKEN -eq $null) { + Write-Error "Missing VSTS_TOKEN environment variable" + exit 1 +} + +if ($env:VSTS_AGENT -ne $null) { + $env:VSTS_AGENT = $($env:VSTS_AGENT) +} +else { + $env:VSTS_AGENT = $env:COMPUTERNAME +} + +if ($env:VSTS_WORK -ne $null) +{ + New-Item -Path $env:VSTS_WORK -ItemType Directory -Force +} +else +{ + $env:VSTS_WORK = "_work" +} + +if($env:VSTS_POOL -eq $null) +{ + $env:VSTS_POOL = "Default" +} + +$useragent = 'vsts-windowscontainer' +$creds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($("user:$env:VSTS_TOKEN"))) +$encodedAuthValue = "Basic $creds" +$acceptHeaderValue = "application/json;api-version=3.0-preview" +$headers = @{Authorization = $encodedAuthValue;Accept = $acceptHeaderValue } +$vstsUrl = "https://$env:VSTS_ACCOUNT.visualstudio.com/_apis/distributedtask/packages/agent?platform=win7-x64&`$top=1" +$response = Invoke-WebRequest -UseBasicParsing -Headers $headers -Uri $vstsUrl -UserAgent $useragent + +$response = ConvertFrom-Json $response.Content + +Write-Host "Download agent to C:\BuildAgent\agent.zip" +Invoke-WebRequest -Uri $response.value[0].downloadUrl -OutFile C:\BuildAgent\agent.zip + +Write-Host "Extract agent.zip" +Expand-Archive -Path C:\BuildAgent\agent.zip -DestinationPath C:\BuildAgent + +Write-Host "Deleting agent.zip" +Remove-Item -Path C:\BuildAgent\agent.zip + +$env:VSO_AGENT_IGNORE="VSTS_AGENT_URL,VSO_AGENT_IGNORE,VSTS_AGENT,VSTS_ACCOUNT,VSTS_TOKEN,VSTS_POOL,VSTS_WORK" +if ($env:VSTS_AGENT_IGNORE -ne $null) +{ + $env:VSO_AGENT_IGNORE="$env:VSO_AGENT_IGNORE,$env:VSTS_AGENT_IGNORE,VSTS_AGENT_IGNORE" +} + +Set-Location -Path "C:\BuildAgent" + +& .\bin\Agent.Listener.exe configure --unattended ` + --agent "$env:VSTS_AGENT" ` + --url "https://$env:VSTS_ACCOUNT.visualstudio.com" ` + --auth PAT ` + --token "$env:VSTS_TOKEN" ` + --pool "$env:VSTS_POOL" ` + --work "$env:VSTS_WORK" ` + --replace + +& .\bin\Agent.Listener.exe run \ No newline at end of file diff --git a/windows/nano/10.0.14393/standard/Dockerfile b/windows/nano/10.0.14393/standard/Dockerfile new file mode 100644 index 0000000..b4d4053 --- /dev/null +++ b/windows/nano/10.0.14393/standard/Dockerfile @@ -0,0 +1,60 @@ +FROM microsoft/vsts-agent:nano-10.0.14393 + +ENV NODE_VERSION 6.9.1 +ENV NODE_DOWNLOAD_URL "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-x64.msi" +RUN powershell -NoProfile -Command \ + $ErrorActionPreference = 'Stop'; \ + Invoke-WebRequest %NODE_DOWNLOAD_URL -OutFile node.msi; \ + msiexec /i node.msi /quiet /norestart; \ + Remove-Item -Force node.msi + +# common node tools +RUN npm install gulp -g && npm install grunt -g && npm install less -g + +# ruby +ENV RUBY_VERSION 2.2.5 \ + RUBY_FOLDER 22 +ENV RUBY_DOWNLOAD_URL "http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-$RUBY_VERSION-x64.exe?direct" +RUN powershell -NoProfile -Command \ + $ErrorActionPreference = 'Stop'; \ + Invoke-WebRequest %RUBY_DOWNLOAD_URL% -OutFile ruby.exe; \ + ruby.exe /verysilent /dir=C:\ruby\$RUBY_FOLDER /tasks=assocfiles,modpath + +# .NET Core SDKs +ENV DOTNET_SDK_VERSION 1.0.0-preview2-1-003177 +ENV DOTNET_SDK_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$DOTNET_SDK_VERSION/dotnet-dev-win-x64.$DOTNET_SDK_VERSION.zip + +RUN powershell -NoProfile -Command \ + $ErrorActionPreference = 'Stop'; \ + Invoke-WebRequest %DOTNET_SDK_DOWNLOAD_URL% -OutFile dotnet.zip; \ + Expand-Archive dotnet.zip -DestinationPath '%ProgramFiles%\dotnet'; \ + Remove-Item -Force dotnet.zip + +# ENV DOTNET_SDK_VERSION 1.0.0-preview3-004056 +# ENV DOTNET_SDK_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$DOTNET_SDK_VERSION/dotnet-dev-win-x64.$DOTNET_SDK_VERSION.zip + +# RUN powershell -NoProfile -Command \ +# $ErrorActionPreference = 'Stop'; \ +# Invoke-WebRequest %DOTNET_SDK_DOWNLOAD_URL% -OutFile dotnet.zip; \ +# Expand-Archive dotnet.zip -DestinationPath '%ProgramFiles%\dotnet'; \ +# Remove-Item -Force dotnet.zip + +ENV DOTNET_VERSION 1.1.0 +ENV DOTNET_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/release/1.1.0/Binaries/$DOTNET_VERSION/dotnet-win-x64.$DOTNET_VERSION.zip + +RUN powershell -NoProfile -Command \ + $ErrorActionPreference = 'Stop'; \ + Invoke-WebRequest %DOTNET_DOWNLOAD_URL% -OutFile dotnet.zip; \ + Expand-Archive dotnet.zip -DestinationPath '%ProgramFiles%\dotnet'; \ + Remove-Item -Force dotnet.zip + +RUN setx /M PATH "%PATH%;%ProgramFiles%\dotnet" + +# Trigger the population of the local package cache +ENV NUGET_XMLDOC_MODE skip + +RUN mkdir warmup \ + && cd warmup \ + && dotnet new \ + && cd .. \ + && rmdir /q/s warmup \ No newline at end of file diff --git a/windows/servercore/10.0.14393/Dockerfile b/windows/servercore/10.0.14393/Dockerfile new file mode 100644 index 0000000..3d32e8d --- /dev/null +++ b/windows/servercore/10.0.14393/Dockerfile @@ -0,0 +1,8 @@ +FROM microsoft/windowsservercore:10.0.14393.447 +ENV WINDOWS_IMAGE_VERSION=10.0.14393.447 + +RUN mkdir C:\BuildAgent +WORKDIR C:/BuildAgent +COPY ./Start.* ./ + +CMD ["Start.cmd"] \ No newline at end of file diff --git a/windows/servercore/10.0.14393/Start.cmd b/windows/servercore/10.0.14393/Start.cmd new file mode 100644 index 0000000..f388b73 --- /dev/null +++ b/windows/servercore/10.0.14393/Start.cmd @@ -0,0 +1 @@ +PowerShell.exe -ExecutionPolicy ByPass .\Start.ps1 diff --git a/windows/servercore/10.0.14393/Start.ps1 b/windows/servercore/10.0.14393/Start.ps1 new file mode 100644 index 0000000..c506272 --- /dev/null +++ b/windows/servercore/10.0.14393/Start.ps1 @@ -0,0 +1,70 @@ +$ErrorActionPreference = "Stop" + +If ($env:VSTS_ACCOUNT -eq $null) { + Write-Error "Missing VSTS_ACCOUNT environment variable" + exit 1 +} + +if ($env:VSTS_TOKEN -eq $null) { + Write-Error "Missing VSTS_TOKEN environment variable" + exit 1 +} + +if ($env:VSTS_AGENT -ne $null) { + $env:VSTS_AGENT = $($env:VSTS_AGENT) +} +else { + $env:VSTS_AGENT = $env:COMPUTERNAME +} + +if ($env:VSTS_WORK -ne $null) +{ + New-Item -Path $env:VSTS_WORK -ItemType Directory -Force +} +else +{ + $env:VSTS_WORK = "_work" +} + +if($env:VSTS_POOL -eq $null) +{ + $env:VSTS_POOL = "Default" +} + +$useragent = 'vsts-windowscontainer' +$creds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($("user:$env:VSTS_TOKEN"))) +$encodedAuthValue = "Basic $creds" +$acceptHeaderValue = "application/json;api-version=3.0-preview" +$headers = @{Authorization = $encodedAuthValue;Accept = $acceptHeaderValue } +$vstsUrl = "https://$env:VSTS_ACCOUNT.visualstudio.com/_apis/distributedtask/packages/agent?platform=win7-x64&`$top=1" +$response = Invoke-WebRequest -UseBasicParsing -Headers $headers -Uri $vstsUrl -UserAgent $useragent + +$response = ConvertFrom-Json $response.Content + +Write-Host "Download agent to C:\BuildAgent\agent.zip" +Invoke-WebRequest -Uri $response.value[0].downloadUrl -OutFile C:\BuildAgent\agent.zip + +Write-Host "Extract agent.zip" +Expand-Archive -Path C:\BuildAgent\agent.zip -DestinationPath C:\BuildAgent + +Write-Host "Deleting agent.zip" +Remove-Item -Path C:\BuildAgent\agent.zip + +$env:VSO_AGENT_IGNORE="VSTS_AGENT_URL,VSO_AGENT_IGNORE,VSTS_AGENT,VSTS_ACCOUNT,VSTS_TOKEN,VSTS_POOL,VSTS_WORK" +if ($env:VSTS_AGENT_IGNORE -ne $null) +{ + $env:VSO_AGENT_IGNORE="$env:VSO_AGENT_IGNORE,$env:VSTS_AGENT_IGNORE,VSTS_AGENT_IGNORE" +} + +Set-Location -Path "C:\BuildAgent" + +& .\bin\Agent.Listener.exe configure --unattended ` + --agent "$env:VSTS_AGENT" ` + --url "https://$env:VSTS_ACCOUNT.visualstudio.com" ` + --auth PAT ` + --token "$env:VSTS_TOKEN" ` + --pool "$env:VSTS_POOL" ` + --work "$env:VSTS_WORK" ` + --replace + +& .\bin\Agent.Listener.exe run \ No newline at end of file diff --git a/windows/servercore/10.0.14393/standard/Dockerfile b/windows/servercore/10.0.14393/standard/Dockerfile new file mode 100644 index 0000000..34ed74a --- /dev/null +++ b/windows/servercore/10.0.14393/standard/Dockerfile @@ -0,0 +1,78 @@ +FROM microsoft/vsts-agent:windows-10.0.14393 + +ENV chocolateyUseWindowsCompression=false +RUN @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" + +RUN choco config set cachelocation C:\chococache + +RUN choco install \ + git \ + nodejs \ + jdk8 \ + curl \ + microsoft-build-tools \ + maven \ + gradle \ + ant \ + docker \ + ruby \ + --confirm \ + ---limit-output \ + --timeout 216000 \ + && rmdir /S /Q C:\chococache + # choco install visualstudio2015community --confirm --timeout 216000 \ + +# common node tools +RUN npm install gulp -g && npm install grunt -g && npm install -g less + +#.NET Core 1.0 Runtime +ENV DOTNET_VERSION 1.0.1 +ENV DOTNET_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$DOTNET_VERSION/dotnet-win-x64.$DOTNET_VERSION.zip + +RUN powershell -NoProfile -Command \ + $ErrorActionPreference = 'Stop'; \ + Invoke-WebRequest %DOTNET_DOWNLOAD_URL% -OutFile dotnet.zip; \ + Expand-Archive dotnet.zip -DestinationPath '%ProgramFiles%\dotnet' -Force; \ + Remove-Item -Force dotnet.zip + +# .NET Core SDK +ENV DOTNET_SDK_VERSION 1.0.0-preview2-1-003177 +ENV DOTNET_SDK_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$DOTNET_SDK_VERSION/dotnet-dev-win-x64.$DOTNET_SDK_VERSION.zip + +RUN powershell -NoProfile -Command \ + $ErrorActionPreference = 'Stop'; \ + Invoke-WebRequest %DOTNET_SDK_DOWNLOAD_URL% -OutFile dotnet.zip; \ + Expand-Archive dotnet.zip -DestinationPath '%ProgramFiles%\dotnet' -Force; \ + Remove-Item -Force dotnet.zip + +# .NET Core 1.1 Runtime +ENV DOTNET_VERSION 1.1.0 +ENV DOTNET_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/release/1.1.0/Binaries/$DOTNET_VERSION/dotnet-win-x64.$DOTNET_VERSION.zip + +RUN powershell -NoProfile -Command \ + $ErrorActionPreference = 'Stop'; \ + Invoke-WebRequest %DOTNET_DOWNLOAD_URL% -OutFile dotnet.zip; \ + Expand-Archive dotnet.zip -DestinationPath '%ProgramFiles%\dotnet' -Force; \ + Remove-Item -Force dotnet.zip + +# .NET Core SDK +# ENV DOTNET_SDK_VERSION 1.0.0-preview3-004056 +# ENV DOTNET_SDK_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$DOTNET_SDK_VERSION/dotnet-dev-win-x64.$DOTNET_SDK_VERSION.zip + +# RUN powershell -NoProfile -Command \ +# $ErrorActionPreference = 'Stop'; \ +# Invoke-WebRequest %DOTNET_SDK_DOWNLOAD_URL% -OutFile dotnet.zip; \ +# Expand-Archive dotnet.zip -DestinationPath '%ProgramFiles%\dotnet' -Force; \ +# Remove-Item -Force dotnet.zip + +RUN setx /M PATH "%PATH%;%ProgramFiles%\dotnet" + +# Trigger the population of the local package cache +ENV NUGET_XMLDOC_MODE skip + +RUN mkdir warmup \ + && cd warmup \ + && dotnet new \ + && cd .. \ + && rmdir /q/s warmup + From 3c8913cd4177f4a05373bccd3bcaba84bf1a4f05 Mon Sep 17 00:00:00 2001 From: Chris Patterson Date: Wed, 16 Nov 2016 22:23:29 -0500 Subject: [PATCH 2/4] Adding comments to nanoserver file --- windows/nano/10.0.14393/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/windows/nano/10.0.14393/Dockerfile b/windows/nano/10.0.14393/Dockerfile index 15fb12d..2ec1979 100644 --- a/windows/nano/10.0.14393/Dockerfile +++ b/windows/nano/10.0.14393/Dockerfile @@ -1,3 +1,6 @@ +# the agent currently will not start on nanoserver due to some powershell issue. + + FROM microsoft/nanoserver:10.0.14393.447 ENV WINDOWS_IMAGE_VERSION 10.0.14393.447 From 4f146bf2c8856cf07524494751cd4e6291530c67 Mon Sep 17 00:00:00 2001 From: Chris Patterson Date: Thu, 8 Dec 2016 09:52:10 -0500 Subject: [PATCH 3/4] minor updates to standard image --- windows/servercore/10.0.14393/standard/Dockerfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/windows/servercore/10.0.14393/standard/Dockerfile b/windows/servercore/10.0.14393/standard/Dockerfile index 34ed74a..d680c6c 100644 --- a/windows/servercore/10.0.14393/standard/Dockerfile +++ b/windows/servercore/10.0.14393/standard/Dockerfile @@ -10,20 +10,19 @@ RUN choco install \ nodejs \ jdk8 \ curl \ - microsoft-build-tools \ maven \ gradle \ ant \ docker \ ruby \ + visualstudio2015community \ --confirm \ ---limit-output \ - --timeout 216000 \ - && rmdir /S /Q C:\chococache + --timeout 216000 # choco install visualstudio2015community --confirm --timeout 216000 \ # common node tools -RUN npm install gulp -g && npm install grunt -g && npm install -g less +RUN npm install gulp -g && npm install grunt -g && npm install -g less && npm install phantomjs -g #.NET Core 1.0 Runtime ENV DOTNET_VERSION 1.0.1 @@ -70,9 +69,10 @@ RUN setx /M PATH "%PATH%;%ProgramFiles%\dotnet" # Trigger the population of the local package cache ENV NUGET_XMLDOC_MODE skip -RUN mkdir warmup \ - && cd warmup \ +RUN mkdir C:\warmup \ + && cd C:\warmup \ && dotnet new \ && cd .. \ - && rmdir /q/s warmup + && rmdir /S /Q C:\warmup \ + && rmdir /S /Q C:\chococache From a029730d53c7185b0f6fca552c6ee2f284ff2cff Mon Sep 17 00:00:00 2001 From: Chris Patterson Date: Wed, 8 Mar 2017 08:49:25 -0800 Subject: [PATCH 4/4] removing nano --- ubuntu/derived/docker/versions | 1 + windows/nano/10.0.14393/Dockerfile | 11 --- windows/nano/10.0.14393/Start.cmd | 1 - windows/nano/10.0.14393/Start.ps1 | 70 ---------------- windows/nano/10.0.14393/standard/Dockerfile | 60 -------------- windows/servercore/10.0.14393/Dockerfile | 4 +- .../servercore/10.0.14393/standard/Dockerfile | 79 ++++++++++--------- 7 files changed, 45 insertions(+), 181 deletions(-) delete mode 100644 windows/nano/10.0.14393/Dockerfile delete mode 100644 windows/nano/10.0.14393/Start.cmd delete mode 100644 windows/nano/10.0.14393/Start.ps1 delete mode 100644 windows/nano/10.0.14393/standard/Dockerfile diff --git a/ubuntu/derived/docker/versions b/ubuntu/derived/docker/versions index ecaf0d4..ddb48f0 100644 --- a/ubuntu/derived/docker/versions +++ b/ubuntu/derived/docker/versions @@ -1,2 +1,3 @@ 1.11.2 8c2e0c35e3cda11706f54b2d46c2521a6e9026a7b13c7d4b8ae1f3a706fc55e1 1.8.0 1.12.1 05ceec7fd937e1416e5dce12b0b6e1c655907d349d52574319a1e875077ccb79 1.8.0 +17.03.0 4a9766d99c6818b2d54dc302db3c9f7b352ad0a80a2dc179ec164a3ba29c2d3e 1.11.0 \ No newline at end of file diff --git a/windows/nano/10.0.14393/Dockerfile b/windows/nano/10.0.14393/Dockerfile deleted file mode 100644 index 2ec1979..0000000 --- a/windows/nano/10.0.14393/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -# the agent currently will not start on nanoserver due to some powershell issue. - - -FROM microsoft/nanoserver:10.0.14393.447 -ENV WINDOWS_IMAGE_VERSION 10.0.14393.447 - -RUN mkdir C:\BuildAgent -WORKDIR C:/BuildAgent -COPY ./Start.* ./ - -CMD ["Start.cmd"] \ No newline at end of file diff --git a/windows/nano/10.0.14393/Start.cmd b/windows/nano/10.0.14393/Start.cmd deleted file mode 100644 index f388b73..0000000 --- a/windows/nano/10.0.14393/Start.cmd +++ /dev/null @@ -1 +0,0 @@ -PowerShell.exe -ExecutionPolicy ByPass .\Start.ps1 diff --git a/windows/nano/10.0.14393/Start.ps1 b/windows/nano/10.0.14393/Start.ps1 deleted file mode 100644 index c506272..0000000 --- a/windows/nano/10.0.14393/Start.ps1 +++ /dev/null @@ -1,70 +0,0 @@ -$ErrorActionPreference = "Stop" - -If ($env:VSTS_ACCOUNT -eq $null) { - Write-Error "Missing VSTS_ACCOUNT environment variable" - exit 1 -} - -if ($env:VSTS_TOKEN -eq $null) { - Write-Error "Missing VSTS_TOKEN environment variable" - exit 1 -} - -if ($env:VSTS_AGENT -ne $null) { - $env:VSTS_AGENT = $($env:VSTS_AGENT) -} -else { - $env:VSTS_AGENT = $env:COMPUTERNAME -} - -if ($env:VSTS_WORK -ne $null) -{ - New-Item -Path $env:VSTS_WORK -ItemType Directory -Force -} -else -{ - $env:VSTS_WORK = "_work" -} - -if($env:VSTS_POOL -eq $null) -{ - $env:VSTS_POOL = "Default" -} - -$useragent = 'vsts-windowscontainer' -$creds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($("user:$env:VSTS_TOKEN"))) -$encodedAuthValue = "Basic $creds" -$acceptHeaderValue = "application/json;api-version=3.0-preview" -$headers = @{Authorization = $encodedAuthValue;Accept = $acceptHeaderValue } -$vstsUrl = "https://$env:VSTS_ACCOUNT.visualstudio.com/_apis/distributedtask/packages/agent?platform=win7-x64&`$top=1" -$response = Invoke-WebRequest -UseBasicParsing -Headers $headers -Uri $vstsUrl -UserAgent $useragent - -$response = ConvertFrom-Json $response.Content - -Write-Host "Download agent to C:\BuildAgent\agent.zip" -Invoke-WebRequest -Uri $response.value[0].downloadUrl -OutFile C:\BuildAgent\agent.zip - -Write-Host "Extract agent.zip" -Expand-Archive -Path C:\BuildAgent\agent.zip -DestinationPath C:\BuildAgent - -Write-Host "Deleting agent.zip" -Remove-Item -Path C:\BuildAgent\agent.zip - -$env:VSO_AGENT_IGNORE="VSTS_AGENT_URL,VSO_AGENT_IGNORE,VSTS_AGENT,VSTS_ACCOUNT,VSTS_TOKEN,VSTS_POOL,VSTS_WORK" -if ($env:VSTS_AGENT_IGNORE -ne $null) -{ - $env:VSO_AGENT_IGNORE="$env:VSO_AGENT_IGNORE,$env:VSTS_AGENT_IGNORE,VSTS_AGENT_IGNORE" -} - -Set-Location -Path "C:\BuildAgent" - -& .\bin\Agent.Listener.exe configure --unattended ` - --agent "$env:VSTS_AGENT" ` - --url "https://$env:VSTS_ACCOUNT.visualstudio.com" ` - --auth PAT ` - --token "$env:VSTS_TOKEN" ` - --pool "$env:VSTS_POOL" ` - --work "$env:VSTS_WORK" ` - --replace - -& .\bin\Agent.Listener.exe run \ No newline at end of file diff --git a/windows/nano/10.0.14393/standard/Dockerfile b/windows/nano/10.0.14393/standard/Dockerfile deleted file mode 100644 index b4d4053..0000000 --- a/windows/nano/10.0.14393/standard/Dockerfile +++ /dev/null @@ -1,60 +0,0 @@ -FROM microsoft/vsts-agent:nano-10.0.14393 - -ENV NODE_VERSION 6.9.1 -ENV NODE_DOWNLOAD_URL "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-x64.msi" -RUN powershell -NoProfile -Command \ - $ErrorActionPreference = 'Stop'; \ - Invoke-WebRequest %NODE_DOWNLOAD_URL -OutFile node.msi; \ - msiexec /i node.msi /quiet /norestart; \ - Remove-Item -Force node.msi - -# common node tools -RUN npm install gulp -g && npm install grunt -g && npm install less -g - -# ruby -ENV RUBY_VERSION 2.2.5 \ - RUBY_FOLDER 22 -ENV RUBY_DOWNLOAD_URL "http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-$RUBY_VERSION-x64.exe?direct" -RUN powershell -NoProfile -Command \ - $ErrorActionPreference = 'Stop'; \ - Invoke-WebRequest %RUBY_DOWNLOAD_URL% -OutFile ruby.exe; \ - ruby.exe /verysilent /dir=C:\ruby\$RUBY_FOLDER /tasks=assocfiles,modpath - -# .NET Core SDKs -ENV DOTNET_SDK_VERSION 1.0.0-preview2-1-003177 -ENV DOTNET_SDK_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$DOTNET_SDK_VERSION/dotnet-dev-win-x64.$DOTNET_SDK_VERSION.zip - -RUN powershell -NoProfile -Command \ - $ErrorActionPreference = 'Stop'; \ - Invoke-WebRequest %DOTNET_SDK_DOWNLOAD_URL% -OutFile dotnet.zip; \ - Expand-Archive dotnet.zip -DestinationPath '%ProgramFiles%\dotnet'; \ - Remove-Item -Force dotnet.zip - -# ENV DOTNET_SDK_VERSION 1.0.0-preview3-004056 -# ENV DOTNET_SDK_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$DOTNET_SDK_VERSION/dotnet-dev-win-x64.$DOTNET_SDK_VERSION.zip - -# RUN powershell -NoProfile -Command \ -# $ErrorActionPreference = 'Stop'; \ -# Invoke-WebRequest %DOTNET_SDK_DOWNLOAD_URL% -OutFile dotnet.zip; \ -# Expand-Archive dotnet.zip -DestinationPath '%ProgramFiles%\dotnet'; \ -# Remove-Item -Force dotnet.zip - -ENV DOTNET_VERSION 1.1.0 -ENV DOTNET_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/release/1.1.0/Binaries/$DOTNET_VERSION/dotnet-win-x64.$DOTNET_VERSION.zip - -RUN powershell -NoProfile -Command \ - $ErrorActionPreference = 'Stop'; \ - Invoke-WebRequest %DOTNET_DOWNLOAD_URL% -OutFile dotnet.zip; \ - Expand-Archive dotnet.zip -DestinationPath '%ProgramFiles%\dotnet'; \ - Remove-Item -Force dotnet.zip - -RUN setx /M PATH "%PATH%;%ProgramFiles%\dotnet" - -# Trigger the population of the local package cache -ENV NUGET_XMLDOC_MODE skip - -RUN mkdir warmup \ - && cd warmup \ - && dotnet new \ - && cd .. \ - && rmdir /q/s warmup \ No newline at end of file diff --git a/windows/servercore/10.0.14393/Dockerfile b/windows/servercore/10.0.14393/Dockerfile index 3d32e8d..10b483f 100644 --- a/windows/servercore/10.0.14393/Dockerfile +++ b/windows/servercore/10.0.14393/Dockerfile @@ -1,5 +1,5 @@ -FROM microsoft/windowsservercore:10.0.14393.447 -ENV WINDOWS_IMAGE_VERSION=10.0.14393.447 +FROM microsoft/windowsservercore:10.0.14393.693 +ENV WINDOWS_IMAGE_VERSION=10.0.14393.693 RUN mkdir C:\BuildAgent WORKDIR C:/BuildAgent diff --git a/windows/servercore/10.0.14393/standard/Dockerfile b/windows/servercore/10.0.14393/standard/Dockerfile index d680c6c..e2e84c4 100644 --- a/windows/servercore/10.0.14393/standard/Dockerfile +++ b/windows/servercore/10.0.14393/standard/Dockerfile @@ -15,54 +15,59 @@ RUN choco install \ ant \ docker \ ruby \ - visualstudio2015community \ --confirm \ - ---limit-output \ + --limit-output \ --timeout 216000 # choco install visualstudio2015community --confirm --timeout 216000 \ +RUN choco install \ + dotnet4.6.1 \ + --confirm \ + --limit-output + +RUN choco install \ + visualstudio2017enterprise --package-parameters "--passive --locale en-US" \ + --confirm \ + --limit-output \ + --timeout 216000 \ + -pre + +RUN choco install \ + visualstudio2017-workload-azure \ + visualstudio2017-workload-netcoretools \ + visualstudio2017-workload-netweb \ + -pre \ + --confirm \ + --limit-output \ + --timeout 21600 \ + --package-parameters "--includeOptional" + # common node tools RUN npm install gulp -g && npm install grunt -g && npm install -g less && npm install phantomjs -g -#.NET Core 1.0 Runtime -ENV DOTNET_VERSION 1.0.1 -ENV DOTNET_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$DOTNET_VERSION/dotnet-win-x64.$DOTNET_VERSION.zip - -RUN powershell -NoProfile -Command \ - $ErrorActionPreference = 'Stop'; \ - Invoke-WebRequest %DOTNET_DOWNLOAD_URL% -OutFile dotnet.zip; \ - Expand-Archive dotnet.zip -DestinationPath '%ProgramFiles%\dotnet' -Force; \ - Remove-Item -Force dotnet.zip - -# .NET Core SDK -ENV DOTNET_SDK_VERSION 1.0.0-preview2-1-003177 -ENV DOTNET_SDK_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$DOTNET_SDK_VERSION/dotnet-dev-win-x64.$DOTNET_SDK_VERSION.zip - -RUN powershell -NoProfile -Command \ - $ErrorActionPreference = 'Stop'; \ - Invoke-WebRequest %DOTNET_SDK_DOWNLOAD_URL% -OutFile dotnet.zip; \ - Expand-Archive dotnet.zip -DestinationPath '%ProgramFiles%\dotnet' -Force; \ - Remove-Item -Force dotnet.zip - -# .NET Core 1.1 Runtime -ENV DOTNET_VERSION 1.1.0 +# Install .NET Core +ENV DOTNET_VERSION 1.1.1 ENV DOTNET_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/release/1.1.0/Binaries/$DOTNET_VERSION/dotnet-win-x64.$DOTNET_VERSION.zip -RUN powershell -NoProfile -Command \ - $ErrorActionPreference = 'Stop'; \ - Invoke-WebRequest %DOTNET_DOWNLOAD_URL% -OutFile dotnet.zip; \ - Expand-Archive dotnet.zip -DestinationPath '%ProgramFiles%\dotnet' -Force; \ - Remove-Item -Force dotnet.zip +RUN Invoke-WebRequest $Env:DOTNET_DOWNLOAD_URL -OutFile dotnet.zip; \ + Expand-Archive dotnet.zip -DestinationPath $Env:ProgramFiles\dotnet; \ + Remove-Item -Force dotnet.zip -# .NET Core SDK -# ENV DOTNET_SDK_VERSION 1.0.0-preview3-004056 -# ENV DOTNET_SDK_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$DOTNET_SDK_VERSION/dotnet-dev-win-x64.$DOTNET_SDK_VERSION.zip +# Install .NET Core +ENV DOTNET_VERSION 1.0.4 +ENV DOTNET_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/preview/Binaries/$DOTNET_VERSION/dotnet-win-x64.$DOTNET_VERSION.zip -# RUN powershell -NoProfile -Command \ -# $ErrorActionPreference = 'Stop'; \ -# Invoke-WebRequest %DOTNET_SDK_DOWNLOAD_URL% -OutFile dotnet.zip; \ -# Expand-Archive dotnet.zip -DestinationPath '%ProgramFiles%\dotnet' -Force; \ -# Remove-Item -Force dotnet.zip +RUN Invoke-WebRequest $Env:DOTNET_DOWNLOAD_URL -OutFile dotnet.zip; \ + Expand-Archive dotnet.zip -DestinationPath $Env:ProgramFiles\dotnet; \ + Remove-Item -Force dotnet.zip + +# Install .NET Core SDK +ENV DOTNET_SDK_VERSION 1.0.1 +ENV DOTNET_SDK_DOWNLOAD_URL https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-dev-win-x64.$DOTNET_SDK_VERSION.zip + +RUN Invoke-WebRequest $Env:DOTNET_SDK_DOWNLOAD_URL -OutFile dotnet.zip; \ + Expand-Archive dotnet.zip -DestinationPath $Env:ProgramFiles\dotnet; \ + Remove-Item -Force dotnet.zip RUN setx /M PATH "%PATH%;%ProgramFiles%\dotnet"