Skip to content

Commit

Permalink
Add msbuild image
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Scherer <[email protected]>
  • Loading branch information
StefanScherer committed Nov 20, 2016
1 parent 921f802 commit d72b8d8
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
15 changes: 15 additions & 0 deletions windows-container-samples/msbuild/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM microsoft/windowsservercore

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop';"]

RUN (New-Object System.Net.WebClient).DownloadFile('http://download.microsoft.com/download/5/f/7/5f7acaeb-8363-451f-9425-68a90f98b238/visualcppbuildtools_full.exe', 'visualcppbuildtools_full.exe') ; \
Start-Process .\visualcppbuildtools_full.exe -ArgumentList '/NoRestart /S' -Wait ; \
rm visualcppbuildtools_full.exe

COPY entrypoint.bat entrypoint.bat

SHELL ["cmd"]

WORKDIR /code

ENTRYPOINT ["C:\\entrypoint.bat"]
17 changes: 17 additions & 0 deletions windows-container-samples/msbuild/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# msbuild

Build a Docker image with Visual C++ Build tools.
The `entrypoint.bat` script calls the `vcbuildtools.bat` script to set all
environment variables.

## Build image

```
docker build -t msbuild .
```

## Use the image

```
docker run -v "$(pwd):C:\code" msbuild msbuild yourproject.sln /p:Configuration=Release
```
5 changes: 5 additions & 0 deletions windows-container-samples/msbuild/entrypoint.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@echo off
pushd C:
call "C:\Program Files (x86)\Microsoft Visual C++ Build Tools\vcbuildtools.bat"
popd
%*

0 comments on commit d72b8d8

Please sign in to comment.