繁体   English   中英

使用自托管容器化代理在 Azure DevOps 中安装 docker 卷

[英]Issue mounting docker volumes in Azure DevOps with Self Hosted Containerized Agent

我设置了一个在容器内运行的自托管 ADO 代理。 当我尝试将我现有的 docker-compose 构建从 Microsoft 代理池转移到我自己的自托管代理时,docker-compose 无法安装卷。 我收到错误消息,说我无法创建目录,因为文件系统是只读的。

ADO 管道任务:

  - task: DockerCompose@0
    displayName: Run Tests
    inputs:
      containerregistrytype: 'Container Registry'
      dockerRegistryEndpoint: 'xxx'
      dockerComposeFile: 'src/docker-compose.yml'
      dockerComposeFileArgs: |
        VOLUME=$(Build.ArtifactStagingDirectory)
      action: 'Run a Docker Compose command'
      dockerComposeCommand: 'up'

Docker 组合:

# to config for local set the variables ${}
# do not check in changes as this file is used by the deployment pipeline

version: '3.3'
services:
    system_tests:
        volumes:
            - '${VOLUME}:/output'
        image: ubuntu:latest

构建错误:

##[error]ERROR: for system_tests  Cannot start service system_tests: error while creating mount source path '/azp/_work/2/a': mkdir /azp: read-only file system

任何建议如何解决这个问题? 我需要将卷挂载到$(Build.ArtifactStagingDirectory)以便我可以将$(Build.ArtifactStagingDirectory) run 中的文件作为 ADO 工件发布。

原来有人已经在这里回答了类似的问题 - https://stackoverflow.com/a/69237696/14983731有一个很好的答案。

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM