首页 > 解决方案 > Azure DevOps 容器作业;在“第二个”图像上运行命令行命令

问题描述

我正在玩 Azure DevOps 容器作业和服务容器。我的用例如下,我(不幸的是)必须在 Private Hosted Build 代理上做所有事情。

我正在容器 A 中作为容器作业运行我的作业。我在容器 B 上安装了使用命令行的特定软件(Fortify)

基本上我希望在容器 A 上运行的步骤之一在容器 B 中运行(使用工作区中的代码进行强化扫描)。当然我可以在一份单独的工作中完成,但我更愿意在同一份工作中完成。

如果目前可行,有什么想法吗?

谢谢

标签: azure-devops

解决方案


酷,我刚刚读到这个功能将在 sprint 163 版本中可用! https://docs.microsoft.com/en-us/azure/devops/release-notes/2020/sprint-163-update

resources:
  containers:
  - container: python
    image: python:3.8
  - container: node
    image: node:13.2

jobs:
- job: example
  container: python

  steps:
  - script: echo Running in the job container

  - script: echo Running on the host
    target: host

  - script: echo Running in another container, in restricted commands mode
    target:
      container: node
      commands: restricted

推荐阅读