{"id":5851,"date":"2018-06-14T17:05:32","date_gmt":"2018-06-15T00:05:32","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/heaths\/?p=3925"},"modified":"2019-02-17T15:29:12","modified_gmt":"2019-02-17T22:29:12","slug":"no-container-image-for-build-tools-for-visual-studio-2017","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/setup\/no-container-image-for-build-tools-for-visual-studio-2017\/","title":{"rendered":"No container image for Build Tools for Visual Studio 2017"},"content":{"rendered":"<p>After having written <a href=\"https:\/\/docs.microsoft.com\/visualstudio\/install\/build-tools-container\">documentation about installing Build Tools for Visual Studio 2017<\/a> and working with partners to set up validation starting with Visual Studio 2017 Version 15.7, a common question from customers and partners alike is: are you going to publish a container image in a Docker registry? With <a href=\"https:\/\/2018.dockercon.com\/\">DockerCon 2018<\/a> in full swing, there&#8217;s no better time to answer this question.<\/p>\n<p>In short, we have no plans to publish such an image. A full <a href=\"https:\/\/www.visualstudio.com\/downloads\">Build Tools<\/a> image is currently ~58GB and contains support for more workloads than probably any developer needs.<\/p>\n<p>We are interested in common customer workload requirements and scenarios and are exploring options to simplify deployment of build environments. Perhaps someday we may publish one or more container images. This is why the <a href=\"https:\/\/docs.microsoft.com\/visualstudio\/install\/advanced-build-tools-container\">documentation<\/a> exists now: to aide our customers and partners to tailor a container image to fit their needs. In Visual Studio 2017 Version 15.7 we made significant improvements to the Build Tools SKU to increase the number of workloads it supports since running the Visual Studio IDE (or even just using its build toolchain) in a container is <a href=\"https:\/\/www.visualstudio.com\/productinfo\/vs2017-system-requirements-vs\">not supported<\/a>. This also greatly increased the size for a full install from previous releases when installing into a container was not officially supported but <a href=\"https:\/\/docs.microsoft.com\/visualstudio\/install\/build-tools-container-issues\">mostly worked<\/a>.<\/p>\n<p>For example, to build the setup engine and installer shell, we would use a Dockerfile similar to the following:<\/p>\n<pre class=\"lang:default decode:true\"># escape=`\r\n\r\n# Copyright (C) Microsoft Corporation. All rights reserved.\r\n\r\n# ARG FROM_IMAGE=microsoft\/dotnet-framework:4.7.1-sdk-windowsservercore-1709\r\nARG FROM_IMAGE=microsoft\/dotnet-framework:3.5-sdk-windowsservercore-1709\r\nFROM ${FROM_IMAGE}\r\n\r\n# Reset the shell.\r\nSHELL [\"cmd\", \"\/S\", \"\/C\"]\r\n\r\n# Set up environment to collect install errors.\r\nCOPY Install.cmd C:\\TEMP\\\r\nADD https:\/\/aka.ms\/vscollect.exe C:\\TEMP\\collect.exe\r\n\r\n# Install Node.js LTS\r\nADD https:\/\/nodejs.org\/dist\/v8.11.3\/node-v8.11.3-x64.msi C:\\TEMP\\node-install.msi\r\nRUN start \/wait msiexec.exe \/i C:\\TEMP\\node-install.msi \/l*vx \"%TEMP%\\MSI-node-install.log\" \/qn ADDLOCAL=ALL\r\n\r\n# Download channel for fixed installed.\r\nARG CHANNEL_URL=https:\/\/aka.ms\/vs\/15\/release\/channel\r\nADD ${CHANNEL_URL} C:\\TEMP\\VisualStudio.chman\r\n\r\n# Download and install Build Tools for Visual Studio 2017.\r\nADD https:\/\/aka.ms\/vs\/15\/release\/vs_buildtools.exe C:\\TEMP\\vs_buildtools.exe\r\nRUN C:\\TEMP\\Install.cmd C:\\TEMP\\vs_buildtools.exe --quiet --wait --norestart --nocache `\r\n    --channelUri C:\\TEMP\\VisualStudio.chman `\r\n    --installChannelUri C:\\TEMP\\VisualStudio.chman `\r\n    --add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools `\r\n    --add Microsoft.Net.Component.3.5.DeveloperTools `\r\n    --add Microsoft.Net.ComponentGroup.4.6.2.DeveloperTools `\r\n    --add Microsoft.Net.ComponentGroup.TargetingPacks.Common `\r\n    --add Microsoft.VisualStudio.Component.TestTools.BuildTools `\r\n    --add Microsoft.VisualStudio.Workload.VCTools `\r\n    --add Microsoft.VisualStudio.Component.VC.140 `\r\n    --add Microsoft.VisualStudio.Component.VC.ATL `\r\n    --add Microsoft.VisualStudio.Component.VC.CLI.Support `\r\n    --add Microsoft.VisualStudio.Component.Windows10SDK.16299.Desktop `\r\n    --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.WinXP `\r\n    --add Microsoft.VisualStudio.Workload.NodeBuildTools `\r\n    --add Microsoft.VisualStudio.Component.TypeScript.2.8 `\r\n    --installPath C:\\BuildTools\r\n\r\n# Use developer command prompt and start PowerShell if no other command specified.\r\nENTRYPOINT C:\\BuildTools\\Common7\\Tools\\VsDevCmd.bat &amp;&amp;\r\nCMD [\"powershell.exe\", \"-NoLogo\", \"-ExecutionPolicy\", \"Bypass\"]<\/pre>\n<p>This uses a slightly older Windows container image since the continuous integration agent runs Windows Server 2016.<\/p>\n<p>Like with this example, you can construct a Dockerfile with whatever tools and libraries you need and either publish it to your own container registry or have developers build and maintain images from source. You could even simplify the process of building and running within the image using docker-compose. This Dockerfile only took ~10 minutes to build and is ~22.5GB (which includes the base image size of ~9GB) expanded. Depending on your network bandwidth building the image could be faster or at least less strain on network infrastructure.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The size and permutations of Build Tools 2017 container images are too great to publish official images, but here&#8217;s how you can create your own tailored images.<\/p>\n","protected":false},"author":389,"featured_media":15107,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[16,45],"class_list":["post-5851","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-docker","tag-visual-studio"],"acf":[],"blog_post_summary":"<p>The size and permutations of Build Tools 2017 container images are too great to publish official images, but here&#8217;s how you can create your own tailored images.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts\/5851","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/users\/389"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/comments?post=5851"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts\/5851\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/media\/15107"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/media?parent=5851"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/categories?post=5851"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/tags?post=5851"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}