forked from yatima1460/Windows-Docker-Images
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NET4.8-VS2019-VCTools.Dockerfile
63 lines (54 loc) · 2.61 KB
/
NET4.8-VS2019-VCTools.Dockerfile
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
52
53
54
55
56
57
58
59
60
61
62
63
# escape=`
# _____________________
# | | | Container OS: Windows
# | | | Tag: 4.8-20210713-windowsservercore-ltsc2019
# | | |
# |_________|_________| Command lines parameters of vs_builttools.exe
# | | | https://docs.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio?view=vs-2019
# | | |
# | | | Packages inside vs_builttools.exe
# |_________|_________| https://docs.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools?view=vs-2019
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-20210713-windowsservercore-ltsc2019
# FROM mcr.microsoft.com/dotnet/framework/sdk@sha256:c6e9c591b9e80e2cb0f8bcb736008ebbc3e3ed23de045523847ef0f9778dbaa6
############################
# Set cmd as default shell #
############################
SHELL ["cmd", "/S", "/C"]
###########################
# Setup vs_buildtools.exe #
###########################
# Copy Install script.
COPY Install.cmd C:\TEMP\
# Download collect.exe in case of an install failure.
ADD https://aka.ms/vscollect.exe C:\TEMP\collect.exe
# Use the latest release channel. For more control, specify the location of an internal layout.
ADD https://aka.ms/vs/16/release/channel C:\TEMP\VisualStudio.chman
ADD https://aka.ms/vs/16/release/vs_buildtools.exe C:\TEMP\vs_buildtools.exe
####################
# VS2019 C++ stuff #
####################
RUN C:\TEMP\Install.cmd C:\TEMP\vs_buildtools.exe --quiet --wait --norestart --nocache `
--installPath C:\BuildTools `
--channelUri C:\TEMP\VisualStudio.chman `
--installChannelUri C:\TEMP\VisualStudio.chman `
--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended
#################################
# Check BuildTools stuff exists #
#################################
RUN MSBuild.exe /version
RUN dir C:\BuildTools\VC\Auxiliary\Build\vcvarsall.bat
##################################################
# Redirect BuildTools for tools hardcoding paths #
##################################################
## Community
RUN mklink /d "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" "C:\BuildTools"
## Professional
RUN mklink /d "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional" "C:\BuildTools"
## Enterprise
RUN mklink /d "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise" "C:\BuildTools"
############################################
# Start init script to show container info #
############################################
COPY Init.bat C:\Init.bat
ENTRYPOINT [ "C:\\Init.bat", "&&"]
CMD ["cmd"]