-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: Add microsoft/msbuild image #492
Proposal: Add microsoft/msbuild image #492
Conversation
|
||
WORKDIR /code | ||
|
||
ENTRYPOINT ["C:\\entrypoint.bat"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lost and found. Perhaps instead of using this entrypoint.bat
we should burn in all environments as done here: https://github.com/friism/hello-world/blob/32b486472ebcd64fd26b0264dc988958bf44ccf5/windows/Dockerfile.build#L14-L19
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the c++ toolchain really likes to be run in cmd
and users are used to interacting with it using the "Visual Studio developer prompt", then I think sticking to cmd
is good. But it also seems like MS is moving towards Powershell: http://news.softpedia.com/news/microsoft-replaces-command-prompt-with-powershell-in-latest-windows-10-build-510328.shtml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I also prefer your solution setting all environment variables. I found the problem with some of the variables. If a value ends with a backslash \
then it is stored with a double quote "
instead. Eg. for the environment variable WindowsSdkDir
.
Replacing the
setx /M $v[0] $v[1]
command with
[Environment]::SetEnvironmentVariable($v[0], $v[1], [EnvironmentVariableTarget]::Machine);
it works fine. I'll update this PR to get rid of the entrypoint.bat
.
d72b8d8
to
d3a97cf
Compare
Removed the entryoint.bat script. |
# msbuild | ||
|
||
Build a Docker image with Visual C++ Build tools. | ||
The `entrypoint.bat` script calls the `vcbuildtools.bat` script to set all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see those scripts. Are they still needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The entrypoint is no longer needed, I'll update the readme.
Thanks for submitting this! I'm trying to see if anyone from the MSBuild team wants to review it. It looks good to me, so if they don't have any feedback I'll get it merged. |
d3a97cf
to
8f2882f
Compare
Updated the README.md. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[I'm an MSBuild maintainer]
We don't currently have a Docker image, nor plans to create one, though @alexellis proposed one: dotnet/msbuild#1140.
Since this isn't just MSBuild I'd rather the name be something like vcbuildtools
.
C# builds are likely to fail without some .NET Targeting Packs installed. Since you're aiming at C++ builds this might not be the place for it.
|
||
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') ; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the "with Update 3" installer, right? (It appears to be, just double-checking.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@StefanScherer why not just use Invoke-WebRequest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@friism After changing the SHELL
line to
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
I can switch back to Invoke-WebRequest
to have the same download rate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you have another commit with that change? I want to get this merged but wasn't sure if you were going to switch back to Invoke-WebRequest or not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the reminder. Updating right now and testing the build again...
## Build image | ||
|
||
``` | ||
docker build -t msbuild . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specify a version? vcbuildtools:14.3
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
Thanks @rainersigwald . I think vcbuildtools would be a better name as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably make clear that this is 64bit toolchain. As @rainersigwald suggested, it might also be worth parametrizing the VS version to 14
|
||
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') ; \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@StefanScherer why not just use Invoke-WebRequest
This (now obsolete) PR has details on how something like this might be used: docker-library/hello-world#22 |
Signed-off-by: Stefan Scherer <[email protected]>
8f2882f
to
7b49862
Compare
@PatrickLang Updated the PR and changed it to master branch. Can't remember why I opened this to live branch directly. |
live branch is actually preferred now but either work. We changed the default to live. |
building without testing (at least unit test level) is quite pointless in nowadays devops tool chains. :) |
Added custom path option to CredSpec docs
Here is a
Dockerfile
to build a Docker image with the Visual Studio C++ Build tools installed.It would be great if we have something like
FROM microsoft/vcbuildtools:14.3
to runmsbuild
in a Container very easily.How to use this image
Build the image
Use the image
Go into a folder with a simple C++ or other project with a solution file *.sln.
Example: