什么是 Docker 注册服务连接?

cra*_*den 6 azure docker azure-devops azure-pipelines azure-container-registry

此文档之后Docker registry service connection可在以下 YAML 中找到。什么是Docker registry service connection,在哪里可以找到?

trigger:
- master

variables:
  # Container registry service connection established during pipeline creation
  dockerRegistryServiceConnection: <Docker registry service connection>
  imageRepository: <Name of your image repository>
  containerRegistry: <Name of the Azure container registry>
  dockerfilePath: '$(Build.SourcesDirectory)/Dockerfile'
  tag: '$(Build.BuildId)'

  # Agent VM image name
  vmImageName: 'ubuntu-latest'

- task: AzureWebAppContainer@1 # Add this at the end of your file
  inputs:
    azureSubscription: '<Azure service connection>'
    appName: '<Name of the container web app>'
    containers: $(containerRegistry)/$(imageRepository):$(tag)
Run Code Online (Sandbox Code Playgroud)

Ame*_*cus 15

mmking的回答涵盖了问题的“what”部分,但没有涵盖在哪里可以找到。

添加“DockerRegistry”服务连接后,从服务连接列表中选择它。该网址将类似于:

https://your-org.visualstudio.com/YourProject/_settings/adminservices?resourceId=0b6c0705-9fbb-40ec-b629-95cd92856257
Run Code Online (Sandbox Code Playgroud)

从查询字符串中获取resourceId(上例中为“0b6c0705-9fbb-40ec-b629-95cd92856257”),并将其用作 dockerRegistryServiceConnection 值。


mmk*_*ing 12

服务连接是外部服务的连接器(请参阅此处)。Docker 注册表服务连接基本上是到 Docker 注册表的连接器。你可以在这里设置:

Azure Devops 项目主页 Azure DevOps 项目设置 添加服务连接


归档时间:

查看次数:

5304 次

最近记录:

4 年,6 月 前