1
- FROM microsoft/dotnet-framework:4.7.2-sdk-windowsservercore-ltsc2019
1
+ # Because its impossible to search for microsoft images anymore:
2
+ # https://hub.docker.com/_/microsoft-dotnet-framework-sdk
3
+ # NOTE: DO NOT use "mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019" as it uses vs2019
4
+ FROM mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2019
5
+
6
+ # https://github.com/microsoft/dotnet-framework-docker/blob/7ea28f0c8e9ca278eb5d38c67fe67987e8432ed8/4.8/sdk/windowsservercore-1903/Dockerfile
2
7
# See https://github.com/Microsoft/dotnet-framework-docker/blob/33531c3bae718f970b704730703ba1fb0f3dff80/4.7.2/sdk/windowsservercore-ltsc2019/Dockerfile
3
8
4
9
# Container Compatibility
5
10
# See https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility
6
11
7
- # We use the same configuration as Microsoft's VSTS agents
8
- # https://github.com/Microsoft/vsts-agent-docker/blob/master/windows/servercore/10.0.14393/standard/VS2017/Dockerfile
12
+ SHELL ["powershell" , "-Command" , "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';" ]
9
13
10
14
ENV chocolateyUseWindowsCompression=false
11
-
12
15
RUN iex (wget 'https://chocolatey.org/install.ps1' -UseBasicParsing)
13
16
17
+ RUN choco feature enable -n=allowGlobalConfirmation
14
18
RUN choco feature disable -n=showDownloadProgress
15
19
RUN choco config set cachelocation C:\c hococache
16
20
@@ -21,24 +25,23 @@ RUN choco install \
21
25
curl \
22
26
maven \
23
27
gradle \
24
- docker \
25
- --confirm \
28
+ docker-cli \
26
29
--limit-output \
27
30
--timeout 3600 \
28
31
; Remove-Item C:\c hococache -Recurse -Force
29
32
33
+ # Package parameters is BROKEN
34
+ # --package-parameters '--passive --includeOptional --locale en-US' \
35
+
30
36
RUN choco install \
31
37
visualstudio2017enterprise \
32
- --package-parameters "--passive --locale en-US --includeOptional" \
33
- --confirm \
34
38
--limit-output \
35
39
--timeout 3600 \
36
40
; Remove-Item C:\c hococache -Recurse -Force
37
41
38
42
RUN choco install \
39
43
visualstudio2017-workload-netcoretools \
40
44
visualstudio2017-workload-netweb \
41
- --confirm \
42
45
--limit-output \
43
46
--timeout 3600 \
44
47
--ignore-package-exit-codes \
@@ -51,53 +54,91 @@ RUN choco install \
51
54
netfx-4.7.2-devpack \
52
55
netfx-4.6.2-devpack \
53
56
netfx-4.5.2-devpack \
54
- netfx-4.0.3-devpack \
55
- --confirm \
56
57
--limit-output \
57
58
--timeout 1800 \
58
59
--ignore-package-exit-codes \
59
60
; Remove-Item C:\c hococache -Recurse -Force
60
61
61
- SHELL ["powershell" , "-Command" , "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';" ]
62
-
63
- # Install .NET Core 1.0.5, 1.1.2
64
- ENV DOTNET_DOWNLOAD_URL https://download.microsoft.com/download/D/7/A/D7A9E4E9-5D25-4F0C-B071-210CB8267943/dotnet-win-x64.1.1.2.zip
65
- ENV DOTNET_SDK_DOWNLOAD_URL https://download.microsoft.com/download/E/7/8/E782433E-7737-4E6C-BFBF-290A0A81C3D7/dotnet-dev-win-x64.1.0.4.zip
62
+ # Download the Build Tools bootstrapper.
63
+ ADD "https://aka.ms/vs/15/release/vs_buildtools.exe" "C:\T EMP\v s_buildtools.exe"
64
+
65
+ SHELL ["cmd" , "/S" , "/C" ]
66
+
67
+ # Installer won't detect DOTNET_SKIP_FIRST_TIME_EXPERIENCE if ENV is used, must use setx /M
68
+ # Install VS components
69
+ RUN setx /M DOTNET_SKIP_FIRST_TIME_EXPERIENCE 1 \
70
+ && start /w C:\T EMP\v s_BuildTools.exe ^ \
71
+ --add Microsoft.VisualStudio.Workload.MSBuildTools ^ \
72
+ --add Microsoft.VisualStudio.Workload.NetCoreBuildTools ^ \
73
+ --add Microsoft.Component.ClickOnce.MSBuild ^ \
74
+ --add Microsoft.VisualStudio.Component.WebDeploy ^ \
75
+ --quiet --norestart --nocache --wait \
76
+ && powershell -Command "if ($err = dir $Env:TEMP -Filter dd_setup_*_errors.log | where Length -gt 0 | Get-Content) { throw $err }" \
77
+ && del C:\T EMP\v s_BuildTools.exe \
78
+ \
79
+ # Cleanup
80
+ && rmdir /S /Q "%ProgramFiles(x86)%\M icrosoft Visual Studio\I nstaller" \
81
+ && powershell Remove-Item -Force -Recurse "%TEMP%\* " \
82
+ && rmdir /S /Q "%ProgramData%\P ackage Cache"
83
+
84
+ # Install web targets
85
+ RUN curl -fSLo MSBuild.Microsoft.VisualStudio.Web.targets.zip https://dotnetbinaries.blob.core.windows.net/dockerassets/MSBuild.Microsoft.VisualStudio.Web.targets.2020.03.zip \
86
+ && tar -zxf MSBuild.Microsoft.VisualStudio.Web.targets.zip -C "%ProgramFiles(x86)%\M icrosoft Visual Studio\2 017\B uildTools\M SBuild\M icrosoft\V isualStudio\v 15.0" \
87
+ && del MSBuild.Microsoft.VisualStudio.Web.targets.zip
88
+
89
+ # Set PATH in one layer to keep image size down.
90
+ RUN powershell setx /M PATH $(${Env:PATH} \
91
+ + \" ;${Env:ProgramFiles}\N uGet\" \
92
+ + \" ;${Env:ProgramFiles(x86)}\M icrosoft Visual Studio\2 017\B uildTools\M SBuild\1 5.0\B in\" \
93
+ + \" ;${Env:ProgramFiles(x86)}\M icrosoft Visual Studio\2 017\E nterprise\C ommon7\I DE\" \
94
+ + \" ;${Env:ProgramFiles(x86)}\M icrosoft Visual Studio\2 017\E nterprise\C ommon7\I DE\C ommonExtensions\M icrosoft\T estWindow\" \
95
+ + \" ;${Env:ProgramFiles(x86)}\M icrosoft SDKs\W indows\v 10.0A\b in\N ETFX 4.8 Tools\" \
96
+ + \" ;${Env:ProgramFiles(x86)}\M icrosoft SDKs\C lickOnce\S ignTool\" )
66
97
67
- RUN Invoke-WebRequest $Env:DOTNET_DOWNLOAD_URL -OutFile dotnet.zip; \
68
- Expand-Archive dotnet.zip -DestinationPath $Env:ProgramFiles\d otnet -Force; \
69
- Remove-Item -Force dotnet.zip
70
-
71
- RUN Invoke-WebRequest $Env:DOTNET_SDK_DOWNLOAD_URL -OutFile dotnet.zip; \
72
- Expand-Archive dotnet.zip -DestinationPath $Env:ProgramFiles\d otnet -Force; \
73
- Remove-Item -Force dotnet.zip
74
-
75
- # Install .NET Core 2.0
76
- ENV DOTNET_DOWNLOAD_URL https://download.microsoft.com/download/5/F/0/5F0362BD-7D0A-4A9D-9BF9-022C6B15B04D/dotnet-runtime-2.0.0-win-x64.zip
77
- ENV DOTNET_SDK_DOWNLOAD_URL https://download.microsoft.com/download/1/B/4/1B4DE605-8378-47A5-B01B-2C79D6C55519/dotnet-sdk-2.0.0-win-x64.zip
98
+ SHELL ["powershell" , "-Command" , "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';" ]
78
99
79
- RUN Invoke-WebRequest $Env:DOTNET_DOWNLOAD_URL -OutFile dotnet.zip; \
80
- Expand-Archive dotnet.zip -DestinationPath $Env:ProgramFiles\d otnet -Force; \
100
+ # Targeting Packs
101
+ RUN "@('4.0', '4.5.2', '4.6.2', '4.7.2', '4.8') | %{ \
102
+ Invoke-WebRequest \
103
+ -UseBasicParsing \
104
+ -Uri https://dotnetbinaries.blob.core.windows.net/referenceassemblies/v${_}.zip \
105
+ -OutFile referenceassemblies.zip; \
106
+ Expand-Archive referenceassemblies.zip \
107
+ -DestinationPath \" ${Env:ProgramFiles(x86)}\R eference Assemblies\M icrosoft\F ramework\. NETFramework\" \
108
+ -Force; \
109
+ Remove-Item -Force referenceassemblies.zip; \
110
+ }"
111
+
112
+ # Install .NET Core 2.1
113
+ RUN Invoke-WebRequest \
114
+ "https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.806/dotnet-sdk-2.1.806-win-x64.zip" \
115
+ -OutFile dotnet.zip; \
116
+ Expand-Archive dotnet.zip \
117
+ -DestinationPath "${Env:ProgramFiles}\d otnet" \
118
+ -Force; \
81
119
Remove-Item -Force dotnet.zip
82
120
83
- RUN Invoke-WebRequest $Env:DOTNET_SDK_DOWNLOAD_URL -OutFile dotnet.zip; \
84
- Expand-Archive dotnet.zip -DestinationPath $Env:ProgramFiles\d otnet -Force; \
121
+ # Install .NET Core 3.1
122
+ RUN Invoke-WebRequest \
123
+ "https://dotnetcli.azureedge.net/dotnet/Sdk/3.1.202/dotnet-sdk-3.1.202-win-x64.zip" \
124
+ -OutFile dotnet.zip; \
125
+ Expand-Archive dotnet.zip \
126
+ -DestinationPath "${Env:ProgramFiles}\d otnet" \
127
+ -Force; \
85
128
Remove-Item -Force dotnet.zip
86
129
87
- # Install .NET Core 2.2
88
- ENV DOTNET_DOWNLOAD_URL https://download.visualstudio.microsoft.com/download/pr/c332d70f-6582-4471-96af-4b0c17a616ad/5f3043d4bc506bf91cb89fa90462bb58/dotnet-sdk-2.2.103-win-x64.zip
130
+ SHELL ["cmd" , "/S" , "/C" ]
89
131
90
- RUN Invoke-WebRequest $Env:DOTNET_DOWNLOAD_URL -OutFile dotnet.zip; \
91
- Expand-Archive dotnet.zip -DestinationPath $Env:ProgramFiles\d otnet -Force; \
92
- Remove-Item -Force dotnet.zip
132
+ # In order to set system PATH, ContainerAdministrator must be used
133
+ USER ContainerAdministrator
134
+ RUN setx /M PATH "%PATH%;C:\P rogram Files\d otnet"
135
+ USER ContainerUser
93
136
94
- RUN [Environment]::SetEnvironmentVariable('PATH' , "${Env:path}" + ';C:\P rogram Files (x86)\M SBuild\1 5.0\B in' , [EnvironmentVariableTarget]::Machine);
95
- RUN [Environment]::SetEnvironmentVariable('PATH' , "${Env:path}" + ';C:\P rogram Files (x86)\M icrosoft Visual Studio\2 017\E nterprise\C ommon7\I DE' , [EnvironmentVariableTarget]::Machine);
96
- RUN [Environment]::SetEnvironmentVariable('PATH' , "${Env:path}" + ';C:\P rogram Files (x86)\M icrosoft Visual Studio\2 017\E nterprise\C ommon7\I DE\C ommonExtensions\M icrosoft\T estWindow' , [EnvironmentVariableTarget]::Machine);
97
- RUN [Environment]::SetEnvironmentVariable('PATH' , "${Env:path}" + ';C:\P rogram Files\d otnet' , [EnvironmentVariableTarget]::Machine);
137
+ SHELL ["powershell" , "-Command" , "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';" ]
98
138
99
139
# Trigger the population of the local package cache
100
140
ENV NUGET_XMLDOC_MODE skip
141
+ ENV DOTNET_CLI_TELEMETRY_OPTOUT 1
101
142
102
143
RUN dotnet --list-sdks ; \
103
144
mkdir C:\w armup ; \
0 commit comments