繁体   English   中英

azure devops 管道 docker 撰写推送任务失败:EACCES:权限被拒绝,scandir '/home/vsts/work/1/s/data'

[英]azure devops pipeline docker compose push task fails with: EACCES: permission denied, scandir '/home/vsts/work/1/s/data'

Compose Push Service 在我的管道中引发以下错误:

##[error]Unhandled: Failed find: 
EACCES: permission denied, scandir '/home/vsts/work/1/s/data'

在此处输入图像描述

管道 YAML-我正在使用 Docker 撰写命令,构建工作正常,其推送到 ACR 失败

  # Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger:
- master

pool:
  vmImage: ubuntu-latest

variables:
  # Container registry service connection established during pipeline creation
  dockerRegistryServiceConnection: 'GUID'
  imageRepository: 'strapiregimg'
  containerRegistry: 'strapireg.azurecr.io'
  dockerfilePath: '$(Build.SourcesDirectory)/Dockerfile'
  tag: '$(Build.BuildId)'

    enter code here


- task: DockerCompose@0
  inputs:
    containerregistrytype: 'Azure Container Registry'
    azureSubscription: ''
    azureContainerRegistry: '{"loginServer":"strapireg.azurecr.io", "id" : ""}'
    dockerComposeFile: '**/docker-compose.yml'
    action: 'Build services'
    includeSourceTags: true
    includeLatestTag: true

- task: DockerCompose@0
  inputs:
    containerregistrytype: 'Azure Container Registry'
    azureSubscription: ''
    azureContainerRegistry: '{"loginServer":"strapireg.azurecr.io", "id" : "'
    dockerComposeFile: '**/docker-compose.yml'
    action: 'Run services'

- task: DockerCompose@0
  inputs:
    containerregistrytype: 'Azure Container Registry'
    azureSubscription: ''
    azureContainerRegistry: '{"loginServer":"strapireg.azurecr.io", "id" : ""}'
    dockerComposeFile: '**/docker-compose.yml'
    action: 'Push services'

错误仅在 Azure 管道上,在本地运行良好

根据PGautami评论发布答案并支持jessehouwing的声明,以帮助其他社区成员进行相关讨论。

当您使用 Docker 撰写命令以通过 ACR 推送服务时,如果您在 docker 之前运行docker run命令, docker push它将帮助您防止文件锁定,以便推送命令起作用。

暂无
暂无

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

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