@@ -15,18 +15,42 @@ RUN C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
15
15
--includeRecommended `
16
16
|| IF "%ERRORLEVEL%" =="3010" EXIT 0
17
17
18
- SHELL ["powershell" , "-Command" ]
18
+ SHELL ["powershell" , "-ExecutionPolicy" , "Bypass" , "-Command" ]
19
+
20
+ # Install chocolatey
21
+ RUN iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1' ))
22
+
23
+ # Install packages
24
+ #
25
+ # We need to get the new value of `$PATH` after `choco install`, but
26
+ # chocolatey's `refreshenv` won't be available until we restart the shell.
27
+ # Make `refreshenv` available right away, by importing the Chocolatey profile
28
+ # module. See https://stackoverflow.com/a/46760714.
29
+ COPY choco-packages.txt C:\
30
+ RUN $ErrorActionPreference = 'Stop' ; `
31
+ choco install -y @(Get-Content C:\c hoco-packages.txt); `
32
+ Import-Module "C:\P rogramData\c hocolatey\h elpers\c hocolateyProfile.psm1" ; `
33
+ refreshenv
19
34
20
35
# Install vcpkg
21
36
ADD https://github.com/Microsoft/vcpkg/archive/master.zip C:\T EMP\v cpkg-master.zip
22
37
RUN $ErrorActionPreference = 'Stop' ; `
23
38
Expand-Archive -Path C:\T EMP\v cpkg-master.zip -DestinationPath .; `
39
+ rm C:\T EMP\v cpkg-master.zip; `
24
40
cd .\v cpkg-master; `
25
41
.\b ootstrap-vcpkg.bat; `
26
42
.\v cpkg integrate install
27
43
28
- # Install packages
44
+ # Install C libraries
45
+ #
46
+ # The `vcpkg` crate searches for libraries matching the target architecture
47
+ # exactly. It won't use x86 libraries on a 64-bit system. Setting the default
48
+ # triplet tells `vcpkg` to install 64-bit versions.
49
+ ENV VCPKG_DEFAULT_TRIPLET=x64-windows
29
50
COPY vc-packages.txt C:\
30
51
RUN .\v cpkg-master\v cpkg install @(Get-Content C:\v c-packages.txt)
31
52
53
+ # Tell the `vcpkg` crate to generate dynamically linked executables
54
+ ENV VCPKGRS_DYNAMIC=1
55
+
32
56
CMD ["powershell.exe" , "-NoLogo" , "-ExecutionPolicy" , "Bypass" ]
0 commit comments