-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.wincore
51 lines (46 loc) · 3.42 KB
/
Dockerfile.wincore
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM mcr.microsoft.com/windows/servercore:ltsc2019
# Visual Studio
RUN powershell -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; $wc = New-Object net.webclient; $wc.Downloadfile('https://aka.ms/vs/15/release/vs_buildtools.exe', 'vs_buildtools.exe')" \
&& C:\vs_BuildTools.exe \
--includeRecommended \
--add Microsoft.Component.MSBuild \
--add Microsoft.VisualStudio.Component.Windows10SDK \
--add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core \
--add Microsoft.VisualStudio.Product.BuildTools \
--add Microsoft.VisualStudio.Workload.MSBuildTools \
--add Microsoft.VisualStudio.Workload.VCTools \
--add Microsoft.VisualStudio.Component.VC.ATL \
--add Microsoft.VisualStudio.Component.VC.ATLMFC \
--add Microsoft.VisualStudio.Component.VC.140 \
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \
--add Microsoft.VisualStudio.Component.Windows10SDK.19041 \
--quiet --wait --norestart --nocache \
&& del C:\vs_BuildTools.exe
# Chocolatey & Git
ENV chocolateyVersion=1.4.0
RUN powershell -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "[System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && \
SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin" && \
%ALLUSERSPROFILE%\chocolatey\bin\choco.exe install -y git && \
%ALLUSERSPROFILE%\chocolatey\bin\choco.exe install -y cmake --version=3.25.1 --installargs 'ADD_CMAKE_TO_PATH=""System""'
# install vcpkg
RUN git clone https://github.com/microsoft/vcpkg C:\vcpkg && \
C:\vcpkg\bootstrap-vcpkg.bat && \
setx path "%path%;C:\vcpkg;C:\vcpkg\installed\x64-windows;C:\vcpkg\installed\x64-windows\bin"
RUN vcpkg install openssl:x64-windows
# install certificate from api.aspose.cloud to container certificates storage
RUN powershell -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command " \
$webRequest = [Net.WebRequest]::Create(""""https://api.aspose.cloud""""); \
$webRequest.GetResponse(); \
$cert = $webRequest.ServicePoint.Certificate; \
$chain = New-Object -TypeName System.Security.Cryptography.X509Certificates.X509Chain; \
$chain.build($cert); \
$chain.ChainElements.Certificate | % {set-content -value $(""""-----BEGIN CERTIFICATE-----`r`n$([System.Convert]::ToBase64String($($_.Export([Security.Cryptography.X509Certificates.X509ContentType]::Cert)), 'InsertLineBreaks'))`r`n-----END CERTIFICATE-----`r`n"""") -encoding Ascii -path """"$($_.Thumbprint).cer""""; CertUtil -addStore Root """"$($_.Thumbprint).cer""""; }; \
"
RUN powershell -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command " \
$webRequest = [Net.WebRequest]::Create(""""https://api-qa.aspose.cloud""""); \
$webRequest.GetResponse(); \
$cert = $webRequest.ServicePoint.Certificate; \
$chain = New-Object -TypeName System.Security.Cryptography.X509Certificates.X509Chain; \
$chain.build($cert); \
$chain.ChainElements.Certificate | % {set-content -value $(""""-----BEGIN CERTIFICATE-----`r`n$([System.Convert]::ToBase64String($($_.Export([Security.Cryptography.X509Certificates.X509ContentType]::Cert)), 'InsertLineBreaks'))`r`n-----END CERTIFICATE-----`r`n"""") -encoding Ascii -path """"$($_.Thumbprint).cer""""; CertUtil -addStore Root """"$($_.Thumbprint).cer""""; }; \
"