是否可以在 Windows 容器中安装 Visual Studio [英] Is it possible to install Visual Studio in a Windows Container

查看:39
本文介绍了是否可以在 Windows 容器中安装 Visual Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 Windows 容器 在 Windows 服务器上?

Is it possible to install any version of Visual Studio in a Windows Container on a Windows Server?

动机是在持续集成系统中使用 Windows Containers 构建软件,从而使构建环境标准化.

The motivation is to use Windows Containers for building software in continuous integration systems, so that the build environment is standardized.

推荐答案

Visual Studio 似乎 在核心服务器上不受官方支持,但我同意能够做到这一点真的很好.让我们试试吧:

Visual Studio seems to not be supported officially on Core Server, but I agree it would be really nice to be able to do this. Let's try:

FROM mcr.microsoft.com/windows/servercore:ltsc2019
SHELL ["powershell"]

RUN Invoke-WebRequest "https://aka.ms/vs/16/release/vs_community.exe" -OutFile "$env:TEMPvs_community.exe" -UseBasicParsing
RUN & "$env:TEMPvs_community.exe" --add Microsoft.VisualStudio.Workload.NetWeb --quiet --wait --norestart --noUpdateInstaller | Out-Default

RUN & 'C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/MSBuild/15.0/Bin/MSBuild.exe' /version

CMD ["powershell"]

(我正在将此图像推送到 lukaslansky/visualstudio-netwebworkload,请谨慎使用.)

(I'm pushing this image into lukaslansky/visualstudio-netwebworkload, use with caution.)

构建的输出是:

[...]
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

所以这似乎有效!您应该使用这些 --add 安装程序参数来指定构建所需的组件,它们对应于您在 GUI 中看到的工作负载和组件.查看文档.

So this seems to work! You should play with those --add installator arguments to specify what components you need precisely for your build, they correspond to workloads and components you see in the GUI. See the documentation.

这篇关于是否可以在 Windows 容器中安装 Visual Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆