├── LICENSE ├── README.md ├── buildall.ps1 ├── msbuild.12.0.Dockerfile ├── msbuild.12.0.build.ps1 ├── msbuild.12.0.entrypoint.bat ├── msbuild.15.0.Dockerfile ├── msbuild.15.0.build.ps1 ├── msbuild.15.0.push.ps1 ├── msbuild.15.5.Dockerfile ├── msbuild.15.5.build.ps1 └── msbuild.15.5.push.ps1 /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 NuGardt Software UG (haftungsbeschränkt) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Microsoft .NET Build Tools as docker image 2 | We created these images to deploy ASP.NET projects on docker. 3 | 4 | ## Microsoft .NET Build Tools 2013 (v12.0) 5 | docker pull nugardt/msbuild:12.0 6 | 7 | ## Microsoft .NET Build Tools 2017 (v15.0) 8 | docker pull nugardt/msbuild:15.0 9 | 10 | ## Microsoft .NET Build Tools 2017 (v15.5) 11 | docker pull nugardt/msbuild:15.5 12 | 13 | ### All Build Tools docker images include: 14 | NET Framework v4.5.2 Developer Pack 15 | NET Framework v4.6.2 Developer Pack 16 | Web Deploy v3.6 17 | NuGet v4.5.0 18 | 19 | ### Usage 20 | 21 | Run from within you root source code directory (where your .SLN is). 22 | 23 | ```powershell 24 | docker run -v "$(pwd):C:\Build\" nugardt/msbuild:15.5 msbuild C:\Build\NuGardt.Contoso.sln /t:rebuild /p:Configuration=Release /p:DeployOnBuild=true /p:PublishProfile=DockerDeploy 25 | ``` 26 | ## MIT License 27 | 28 | Copyright (c) 2018 NuGardt Software UG (haftungsbeschränkt) 29 | 30 | Permission is hereby granted, free of charge, to any person obtaining a copy 31 | of this software and associated documentation files (the "Software"), to deal 32 | in the Software without restriction, including without limitation the rights 33 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 34 | copies of the Software, and to permit persons to whom the Software is 35 | furnished to do so, subject to the following conditions: 36 | 37 | The above copyright notice and this permission notice shall be included in all 38 | copies or substantial portions of the Software. 39 | 40 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 41 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 42 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 43 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 44 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 45 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 46 | SOFTWARE. 47 | -------------------------------------------------------------------------------- /buildall.ps1: -------------------------------------------------------------------------------- 1 | ./msbuild.12.0.build.ps1 2 | ./msbuild.15.0.build.ps1 3 | ./msbuild.15.5.build.ps1 -------------------------------------------------------------------------------- /msbuild.12.0.Dockerfile: -------------------------------------------------------------------------------- 1 | FROM microsoft/windowsservercore:10.0.14393.1715 2 | SHELL ["powershell.exe", "-ExecutionPolicy", "Bypass", "-Command"] 3 | 4 | LABEL maintainer "kevin@nugardt.com"; \ 5 | LABEL lastupdate "2018-02-05"; \ 6 | LABEL version "2018.02.05"; \ 7 | LABEL author "Kevin Gardthausen"; \ 8 | LABEL vendor "NuGardt Software UG (haftungsbeschränkt)"; \ 9 | LABEL homepage "http://www.nugardt.com;" \ 10 | LABEL description "Microsoft .NET Build Tools 2013 (v12.0) with NuGet v4.5.0, Web Deploy v3.5, Developer Packs v4.5.2, 4.6.2 and .Net Core v1.1.7 and v2.1.4 SDK."; \ 11 | LABEL license MIT license; \ 12 | LABEL comment based on alexellisio/msbuild:12.0 and https://blogs.msdn.microsoft.com/heaths/2017/09/18/installing-build-tools-for-visual-studio-2017-in-a-docker-container/; 13 | 14 | # Download log collection utility 15 | RUN $ErrorActionPreference = 'Stop'; \ 16 | $ProgressPreference = 'SilentlyContinue'; \ 17 | $VerbosePreference = 'Continue'; \ 18 | Invoke-WebRequest -Uri https://aka.ms/vscollect.exe -OutFile C:\collect.exe 19 | 20 | COPY msbuild.12.0.entrypoint.bat entrypoint.bat 21 | 22 | # Note: Add .NET + ASP.NET 23 | RUN Install-WindowsFeature NET-Framework-45-ASPNET ; \ 24 | Install-WindowsFeature Web-Asp-Net45 25 | 26 | # Download NuGardt v4.5.0 27 | RUN $ErrorActionPreference = 'Stop'; \ 28 | $ProgressPreference = 'SilentlyContinue'; \ 29 | $VerbosePreference = 'Continue'; \ 30 | New-Item -Path C:\nuget -Type Directory | Out-Null; \ 31 | [System.Environment]::SetEnvironmentVariable('PATH', "\"${env:PATH};C:\nuget\"", 'Machine'); \ 32 | Invoke-WebRequest -Uri "https://dist.nuget.org/win-x86-commandline/v4.5.0/nuget.exe" -OutFile C:\nuget\nuget.exe; 33 | 34 | # Download and install .Net 4.5.2 Developer Pack 35 | RUN $ErrorActionPreference = 'Stop'; \ 36 | $ProgressPreference = 'SilentlyContinue'; \ 37 | $VerbosePreference = 'Continue'; \ 38 | Invoke-WebRequest "https://download.microsoft.com/download/4/3/B/43B61315-B2CE-4F5B-9E32-34CCA07B2F0E/NDP452-KB2901951-x86-x64-DevPack.exe" -OutFile "$env:TEMP\NDP452-KB2901951-x86-x64-DevPack.exe" -UseBasicParsing; \ 39 | $p = Start-Process -Wait -PassThru -FilePath "$env:TEMP\NDP452-KB2901951-x86-x64-DevPack.exe" -ArgumentList "/install","/quiet"; \ 40 | if ($ret = $p.ExitCode) { c:\collect.exe; throw ('Install failed with exit code 0x{0:x}' -f $ret) }; \ 41 | rm "$env:TEMP\NDP452-KB2901951-x86-x64-DevPack.exe" 42 | 43 | # Download and install .Net 4.6.2 Developer Pack 44 | RUN $ErrorActionPreference = 'Stop'; \ 45 | $ProgressPreference = 'SilentlyContinue'; \ 46 | $VerbosePreference = 'Continue'; \ 47 | Invoke-WebRequest "https://download.microsoft.com/download/E/F/D/EFD52638-B804-4865-BB57-47F4B9C80269/NDP462-DevPack-KB3151934-ENU.exe" -OutFile "$env:TEMP\NDP462-DevPack-KB3151934-ENU.exe" -UseBasicParsing; \ 48 | $p = Start-Process -Wait -PassThru -FilePath "$env:TEMP\NDP462-DevPack-KB3151934-ENU.exe" -ArgumentList "/install","/quiet"; \ 49 | if ($ret = $p.ExitCode) { c:\collect.exe; throw ('Install failed with exit code 0x{0:x}' -f $ret) }; \ 50 | rm "$env:TEMP\NDP462-DevPack-KB3151934-ENU.exe" 51 | 52 | # Download and install Web Deploy v3.6 53 | RUN $ErrorActionPreference = 'Stop'; \ 54 | $ProgressPreference = 'SilentlyContinue'; \ 55 | $VerbosePreference = 'Continue'; \ 56 | Invoke-WebRequest "https://download.microsoft.com/download/0/1/D/01DC28EA-638C-4A22-A57B-4CEF97755C6C/WebDeploy_amd64_en-US.msi" -OutFile "$env:TEMP\WebDeploy_amd64_en-US.msi" -UseBasicParsing; \ 57 | $p = Start-Process -Wait -PassThru -FilePath "msiexec" -ArgumentList """/i ""$env:TEMP\WebDeploy_amd64_en-US.msi"" /quiet"""; \ 58 | if ($ret = $p.ExitCode) { c:\collect.exe; throw ('Install failed with exit code 0x{0:x}' -f $ret) }; \ 59 | rm "$env:TEMP\WebDeploy_amd64_en-US.msi" 60 | 61 | # Download and install .Net Core v1.1.7 SDK 62 | RUN $ErrorActionPreference = 'Stop'; \ 63 | $ProgressPreference = 'SilentlyContinue'; \ 64 | $VerbosePreference = 'Continue'; \ 65 | Invoke-WebRequest "https://download.microsoft.com/download/4/E/6/4E64A465-F02E-43AD-9A86-A08A223A82C3/dotnet-dev-win-x64.1.1.7.exe" -OutFile "$env:TEMP\dotnet-dev-win-x64.1.1.7.exe" -UseBasicParsing; \ 66 | $p = Start-Process -Wait -PassThru -FilePath "$env:TEMP\dotnet-dev-win-x64.1.1.7.exe" -ArgumentList "/install","/quiet"; \ 67 | if ($ret = $p.ExitCode) { c:\collect.exe; throw ('Install failed with exit code 0x{0:x}' -f $ret) }; \ 68 | rm "$env:TEMP\dotnet-dev-win-x64.1.1.7.exe" 69 | 70 | # Download and install .Net Core v2.1.4 SDK 71 | RUN $ErrorActionPreference = 'Stop'; \ 72 | $ProgressPreference = 'SilentlyContinue'; \ 73 | $VerbosePreference = 'Continue'; \ 74 | Invoke-WebRequest "https://download.microsoft.com/download/1/1/5/115B762D-2B41-4AF3-9A63-92D9680B9409/dotnet-sdk-2.1.4-win-x64.exe" -OutFile "$env:TEMP\dotnet-sdk-2.1.4-win-x64.exe" -UseBasicParsing; \ 75 | $p = Start-Process -Wait -PassThru -FilePath "$env:TEMP\dotnet-sdk-2.1.4-win-x64.exe" -ArgumentList "/install","/quiet"; \ 76 | if ($ret = $p.ExitCode) { c:\collect.exe; throw ('Install failed with exit code 0x{0:x}' -f $ret) }; \ 77 | rm "$env:TEMP\dotnet-sdk-2.1.4-win-x64.exe" 78 | 79 | RUN $ErrorActionPreference = 'Stop'; \ 80 | $VerbosePreference = 'Continue'; \ 81 | #$ProgressPreference = 'SilentlyContinue'; \ 82 | Invoke-WebRequest -Uri "https://download.microsoft.com/download/9/B/B/9BB1309E-1A8F-4A47-A6C5-ECF76672A3B3/BuildTools_Full.exe" -OutFile $env:TEMP\BuildTools_Full.exe; \ 83 | $p = Start-Process -Wait -PassThru -FilePath $env:TEMP\BuildTools_Full.exe -ArgumentList '/Silent /Full'; \ 84 | if ($ret = $p.ExitCode) { c:\collect.exe; throw ('Install failed with exit code 0x{0:x}' -f $ret) }; \ 85 | rm "$env:TEMP\BuildTools_Full.exe" 86 | 87 | #Set PATH variable 88 | RUN $env:PATH = 'C:\Program Files (x86)\MSBuild\12.0\Bin\;C:\nuget\;' + $env:PATH; \ 89 | [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); 90 | 91 | # Get Web Targets and move them 92 | RUN New-Item -ItemType directory -Path 'C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\'; \ 93 | "C:\nuget\nuget.exe" Install MSBuild.Microsoft.VisualStudio.Web.targets -Version 12.0.4; \ 94 | mv 'C:\MSBuild.Microsoft.VisualStudio.Web.targets.12.0.4\tools\VSToolsPath\*' 'C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\' 95 | 96 | # Use shell form to start and any other commands specified 97 | #SHELL ["cmd.exe", "/s", "/c"] 98 | ENTRYPOINT C:\entrypoint.bat 99 | 100 | # Default to PowerShell console running within developer command prompt environment 101 | CMD ["powershell.exe", "-nologo"] -------------------------------------------------------------------------------- /msbuild.12.0.build.ps1: -------------------------------------------------------------------------------- 1 | docker build -f msbuild.12.0.Dockerfile -t nugardt/msbuild:12.0 . -------------------------------------------------------------------------------- /msbuild.12.0.entrypoint.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | %* -------------------------------------------------------------------------------- /msbuild.15.0.Dockerfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NuGardt/docker-msbuild/b58243803648f34947b82b6a0383624f173c9eb8/msbuild.15.0.Dockerfile -------------------------------------------------------------------------------- /msbuild.15.0.build.ps1: -------------------------------------------------------------------------------- 1 | docker build -f msbuild.15.0.Dockerfile -t nugardt/msbuild:15.0 . -------------------------------------------------------------------------------- /msbuild.15.0.push.ps1: -------------------------------------------------------------------------------- 1 | docker push nugardt/msbuild:15.0 -------------------------------------------------------------------------------- /msbuild.15.5.Dockerfile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NuGardt/docker-msbuild/b58243803648f34947b82b6a0383624f173c9eb8/msbuild.15.5.Dockerfile -------------------------------------------------------------------------------- /msbuild.15.5.build.ps1: -------------------------------------------------------------------------------- 1 | docker build -f msbuild.15.5.Dockerfile -t nugardt/msbuild:15.5 . -------------------------------------------------------------------------------- /msbuild.15.5.push.ps1: -------------------------------------------------------------------------------- 1 | docker push nugardt/msbuild:15.5 --------------------------------------------------------------------------------