Sign inSign up

chemsorly/msbuilder

By chemsorly

Updated over 7 years ago
Archived

CI image for windows: .NET 4.7.1 with msbuild and C#7 (VS2017)

Image
5

10K+

chemsorly/msbuilder repository overview

Github: https://github.com/Chemsorly/Msbuilder

Description

This container image allows you to build and test your C#/.NET solution inside a docker container, making it unnecessary to install devtools on the CI machine. It contains the tools a standard visual studio 2017 installation would deploy, enabling compilation of most solutions (including office).

Image contents

  • Msbuild Tools 2017 (Visual Studio 2017, supports C#7)
  • SDK for .NET 4.5 (Windows 8), .NET 4.6.2 (Windows 10) and .NET 4.7.1
  • Nuget
  • basic bootstrapper packages for ClickOnce
  • Office 2015 targets and assemblies in GAC.
  • VSC contains a full visual studio 2017 community installation (hence the size). Use it if the base image does not work because of missing dependencies.
  • 1.x.x contains Version 14, 2.x.x Version 15

Notes:

  • Currently only works with Windows Server Containers because it handles the GAC differently than Hyper-V containers. Might work on Hyper-V devices if image was built on Hyper-V (needs further testing).
  • MSBuild in combination with .NET standard 2.0 does not work properly.

Credits to @alexellisio (see http://blog.alexellis.io/3-steps-to-msbuild-with-docker/) for the initial dockerfile

Dockerfiles

With MSBuild tools With Visual Studio Community

Example usage:

Dockerfile:

FROM chemsorly/msbuilder:latest
SHELL ["powershell"]
COPY . 'C:\\build\\'  
WORKDIR 'C:\\build\\'
RUN ["nuget.exe", "restore"]  
RUN & msbuild PROJECTNAME.sln  

CI config (Gitlab-CI.yml)

- 'docker build -f YOURDOCKERFILE -t YOURTAG . '
- docker create --name YOURCONTAINERNAME YOURTAG
- docker cp YOURCONTAINERNAME:C:\\build\\ YOUROUTPUTDIRECTORY

Tag summary

Content type

Image

Digest

Size

26.9 GB

Last updated

over 7 years ago

docker pull chemsorly/msbuilder