简体   繁体   English

是在自托管 Azure DevOps 代理上安装 dotnet SDK 更好,还是在构建管道中添加 UseDotNet@2 任务?

[英]Is it better to install dotnet SDK on self-hosted Azure DevOps agent, or add the UseDotNet@2 task in the build pipeline?

I have configured a self-hosted Linux agent based on Ubuntu 20.04 running in a Docker container.我已经配置了一个基于 Ubuntu 20.04 在 Docker 容器中运行的自托管 Linux 代理。 It reports in to the agent pool and runs correctly.它向代理池报告并正确运行。 I'll be running the agents in AWS Fargate.我将在 AWS Fargate 中运行代理。

My question is whether it is considered a best practice to install the dotnet SDK in my Docker image, which will increase the size of the image considerably, or if it is better to leave it out and require build pipelines to install it via the UseDotNet@2 task, which would cause a delay every time a new agent spins up?我的问题是,在我的 Docker 映像中安装 dotnet SDK 是否被认为是最佳实践,这会显着增加映像的大小,或者最好将其排除在外并需要构建管道通过 UseDotNet@ 安装它2 任务,每次新代理启动时都会导致延迟?

Is there a best practice or general guidance, and can anyone cite documentation?是否有最佳实践或一般指导,任何人都可以引用文档吗?

Thanks!谢谢!

I prefer UseDotNet@2 task.我更喜欢 UseDotNet@2 任务。 UseDotNet@2 task acquire a specific version of .NET Core from the Internet or the tools cache and add it to the PATH. UseDotNet@2 任务从 Internet 或工具缓存中获取特定版本的 .NET Core 并将其添加到 PATH。 This task can change the version of .NET Core used in subsequent tasks.此任务可以更改后续任务中使用的 .NET Core 的版本。 Even you install dotnet SDK on the agent machine, you would also need use UseDotNet@2 task to change the version of .NET Core.即使您在代理机器上安装了 dotnet SDK,您也需要使用 UseDotNet@2 任务来更改 .NET Core 的版本。 And if you update the sdk on the machine, it may cause pipeline run broken.如果你更新机器上的 sdk,可能会导致管道运行中断。 Although there may some delay when a new agent spins up, it only cause delay on the first run.虽然新代理启动时可能会有一些延迟,但它只会在第一次运行时造成延迟。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure Devops - UI 测试无法在自托管代理上运行 - Azure Devops - UI tests fail to run on Self hosted agent 自托管构建代理 - CS2012:无法打开。dll 用于写入,访问被拒绝 - Self-Hosted build agent - CS2012: Cannot open .dll for writing, access denied 将自托管的SignalR后端部署到Azure - Deploy a self-hosted SignalR backend to Azure Azure DevOps Build Pipeline:“publish”命令正在执行“dotnet build”而不是“dotnet publish” - Azure DevOps Build Pipeline: 'publish' command is executing 'dotnet build' instead of 'dotnet publish' ApiController中的长时间运行任务(使用WebAPI,自托管OWIN) - Long running task in ApiController (using WebAPI, self-hosted OWIN) 添加对常见项目Azure DevOps构建管道的引用 - Add reference to Common project Azure DevOps Build Pipeline 使用 azure devops 构建 .net 核心项目。 我想控制使用的 sdk/runtime,将我的 sdk/runtime 添加到哪个位置以供代理拾取? - using azure devops to build .net core project . I want to control the sdk/runtime used, which location to add my sdk/runtime for agent to pickup? 如何使用Private Linux Hosted Build Agent从VSTS进行Dotnet发布? - How to Dotnet Publish from VSTS with Private Linux Hosted Build Agent? Azure 管道 dotnet 未创建发布版本 - Azure Pipeline dotnet not creating release build Azure DevOps 为 Winforms 应用程序构建 PIpeline - Azure DevOps Build PIpeline for Winforms Application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM